home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / program / ny_src.zip / FIGHTS.CPP < prev    next >
C/C++ Source or Header  |  1997-04-22  |  144KB  |  5,315 lines

  1.  
  2. #include "NY2008.h"
  3. #include "fights.h"
  4.  
  5. extern unsigned _stklen;
  6.  
  7. extern struct ffblk fff;
  8.  
  9. long menu_index[END];
  10. //extern int fast_mail;
  11. extern int no_rip_m;
  12. extern int expert;
  13. extern int single_node;
  14. extern char c_dir_g;
  15. extern int no_forrest_IGM;
  16.  
  17. extern int busted_ch_bank;
  18. extern int busted_ch_food;
  19. extern int busted_ch_rape;
  20. extern int busted_ch_beggar;
  21. extern int busted_ch_car;
  22. extern int busted_ch_school;
  23. extern int busted_ch_window;
  24. extern int busted_ch_poison;
  25. extern int busted_ch_bomb;
  26. extern int success_ch_bank;
  27. extern int success_ch_food;
  28. extern int success_ch_rape;
  29. extern int success_ch_beggar;
  30. extern int success_ch_car;
  31. extern int success_ch_school;
  32. extern int success_ch_window;
  33. extern int success_ch_poison;
  34. extern int success_ch_bomb;
  35. extern int clean_mode;
  36. extern int nCurrentUserNumber;
  37. extern user_rec cur_user;
  38. extern enemy enemy_rec;
  39. extern int registered;
  40. extern char uname[36];
  41. extern int do_maint;
  42. extern char str[15];
  43. extern int expert;
  44. extern int rip;
  45. extern char *t_buffer;
  46. extern char *ver;
  47. extern char *verinfo;
  48. extern int gamedisk,flagdisk;
  49. extern char gamedir[MAXDIR],flagdir[MAXDIR];
  50. extern char c_dir_g;
  51. extern int no_wrt_sts;
  52. extern int no_kernel;
  53.  
  54.  
  55. //extern struct door_info;
  56.  
  57.  
  58. /*
  59. void    fight_ops(void);
  60. char    fight();
  61. void    attack_ops(void);
  62. char    attack();
  63. int     attack_points();
  64. int    monster_hit();
  65. int    random();
  66. void    attack_sequence();
  67.   */
  68.  
  69. void any_attack_ops(user_rec *user_on, char fight_name[], char en_name[], long en_hitpoints, long en_strength, long en_defense, weapon en_arm)
  70. {
  71.     long hit_s; //the attacking stregth
  72.     long def_s;
  73.     long en_hit_s;
  74.     long en_def_s;
  75.  
  76.     FILE *justfile;
  77.     //enemy_idx eidx;
  78.        //    int first,last;//,moneis;
  79.     long intval;
  80.        //    enemy erec;
  81.     char key;
  82.  
  83.     wrt_sts();
  84.  
  85.     od_printf("\n\r\n");
  86.  
  87.     ny_clr_scr();
  88.  
  89.  
  90.     ny_line(201,0,0);
  91. //    You meet
  92.     ny_disp_emu(en_name);
  93.     ny_line(202,0,2);
  94. //     ...
  95.     ny_line(203,0,0);
  96. //    H`4e got a bad lokin' `0");
  97.     print_arm(en_arm);
  98.  
  99.  
  100. //    long enhitp;
  101. //    enhitp=en_hitpoints;
  102.  
  103.     do {
  104.  
  105.       bam_af:
  106.  
  107. //      ny_line(204,3,2);
  108. //      ny_disp_emu("\n\r\n\n\r`@S`4treet `@F`4ight\n\r\n`0");
  109.       od_disp_str("\n\n\n\r");
  110.       ny_disp_emu(fight_name);
  111.       od_disp_str("\n\n\r");
  112.       od_set_attrib(0x0a);
  113.       ny_disp_emu(en_name);
  114.       ny_line(205,0,0);
  115. //      ny_disp_emu("'s `@H`4itpoints:");
  116.       od_printf("%s",D_Num(en_hitpoints));
  117.       ny_line(206,1,0);
  118. //      ny_disp_emu("\n\r`@Y`4er `@H`4itpoints: ");
  119.       od_printf("%s\n\r\n",D_Num(user_on->hitpoints));
  120. /*      ny_disp_emu("\n\r\n`@[A] `4- `@A`4ttack\n\r");
  121.       ny_disp_emu("`@[T] `4- `@T`4ake `@D`4rug `@A`4nd `@A`4ttack\n\r");
  122.       ny_disp_emu("`@[G] `4- `@G`4et `@O`4utta `@H`4ere\n\r");
  123.       ny_disp_emu("`@[Y] `4- `@Y`4er `@S`4tats\n\r");*/
  124.       ny_send_menu(ATTACK,"");
  125.       ny_line(207,1,0);
  126.       //ny_disp_emu("\n\r`@W`4hat ya gonna do? (`@[A] T G Y`4)");
  127.  
  128.       key=od_get_answer("ATKPRGY\n\r");
  129.       if (key=='\n' || key=='\r') key='A';
  130.  
  131.       od_putch(key);
  132.  
  133.       if(key=='R' && user_on->rocks==0) {
  134.         ny_line(445,2,1);
  135.         WaitForEnter();
  136.         goto bam_af;
  137.       }
  138.  
  139.  
  140.       if (key == 'T') {  // Take drugs
  141.         take_drug();
  142.         no_rip_m=0;
  143.         key='A';
  144.       }
  145.       if (key=='A' || key=='K' || key=='P' || key=='R') {
  146.         // when atacking
  147. //        randomize();
  148.         if(key=='K') {
  149.           hit_s=random(150 - user_on->kick_ability);
  150.           if(hit_s<35) {
  151.         hit_s = (long)user_on->strength * (pow((user_on->level/2)+2,1.2)*6.0*(user_on->kick_ability/100.0)) * (double)((random(80)+90)/100.0);
  152.         ny_line(439,2,0);
  153.           } else {
  154.         hit_s=0;
  155.         ny_line(440,2,0);
  156.           }
  157.         } else if(key=='P') {
  158.           hit_s=random(140 - user_on->punch_ability);
  159.           if(hit_s<35) {
  160.         hit_s = (long)user_on->strength * (pow((user_on->level/2)+1,1.2)*6.0*(user_on->punch_ability/90.0)) * (double)((random(80)+90)/100.0);
  161.         ny_line(441,2,0);
  162.           } else {
  163.         hit_s=0;
  164.         ny_line(442,2,0);
  165.           }
  166.         } else if(key=='R') {
  167.           hit_s=random(145 - user_on->throwing_ability);
  168.           user_on->rocks--;
  169.           if(hit_s<35) {
  170.         hit_s = (long)user_on->strength * (pow((user_on->level/2)+2,1.2)*6.0*(user_on->throwing_ability/110.0)) * (double)((random(80)+90)/100.0);
  171.         ny_line(443,2,0);
  172.           } else {
  173.         hit_s=0;
  174.         ny_line(444,2,0);
  175.           }
  176.         }
  177.  
  178.         attack_again_a:;
  179.         if(key=='A')
  180.           hit_s = (long)user_on->strength * (what_arm_force(user_on->arm)) * (double)((random(80)+90)/100.0);
  181.         // If he is on drugs
  182.         if(user_on->drug_high > 0)
  183.           hit_s = (hit_s * what_drug_force_a(user_on->drug,user_on->drug_high));
  184.  
  185. //        hit_s*=pow(1.1,user_on->level);
  186.  
  187.         hit_s*=(100.0-(user_on->since_got_laid*2))/100.0;
  188.         if (user_on->drug>=COKE) hit_s-=random(user_on->drug_days_since * pow((double)user_on->drug_addiction,1.2))/60;
  189.         if (hit_s<0) hit_s=0;
  190.  
  191.         en_hit_s = en_strength * (what_arm_force(en_arm)) * (double)((random(75)+60)/100.0);
  192.  
  193.         def_s = user_on->defense * what_drug_force_d(user_on->drug,user_on->drug_high) * (double)((random(80)+140)/100.0);
  194.         def_s*=pow(1.2,user_on->level);
  195.         def_s*=(100.0-(user_on->since_got_laid*2))/100.0;
  196.         if (user_on->drug>=COKE) def_s-=random(user_on->drug_days_since * pow(user_on->drug_addiction,1.2))/60;
  197.         if (def_s<0) def_s=0;
  198.  
  199.         en_def_s = en_defense * (double)((random(75)+50)/100.0);
  200.  
  201.         def_s/=2;
  202.         en_def_s/=2;
  203.  
  204.         en_hit_s-=def_s;
  205.         if (en_hit_s<0) en_hit_s=0;
  206.  
  207.         hit_s-=en_def_s;
  208.         if (hit_s<0) hit_s=0;
  209.  
  210.         if (hit_s==0 && en_hit_s==0 && key=='A') goto attack_again_a;
  211.  
  212.         en_hitpoints-=hit_s;
  213.  
  214.  
  215.         ny_line(208,2,0);
  216. //        od_printf("\n\r\n`bright red`Y`red`a kick `bright green`");
  217.         ny_disp_emu(en_name);
  218.         ny_line(209,0,0);
  219. //        od_printf("'s `red`ass fer `bright green`
  220.         od_printf(D_Num(hit_s));
  221.         ny_line(210,0,0);
  222. //        %s `red`damage",D_Num(hit_s));
  223.  
  224.  
  225.         if (en_hitpoints>0) {
  226.  
  227.           ny_disp_emu("\n\r\n`0");
  228.           ny_disp_emu(en_name);
  229.  
  230.           ny_line(211,0,0);
  231.           //od_printf(" `red`kicks yer ass fer `bright green`
  232.           od_printf(D_Num(en_hit_s));
  233.           ny_line(210,0,0);
  234.           user_on->hitpoints-=en_hit_s;
  235.           wrt_sts();
  236.           if (user_on->hitpoints<=0) {
  237.         od_printf("\n\r\n");
  238.         ny_send_menu(ASS_KICKED,"");
  239. /*        od_printf("You had yer ass kicked ... oh well that happens\n\rCome back tomorrow to get revenge ...\n\r");
  240.         od_printf("You lost all the money on ya...");
  241.         od_printf("\n\rAnd 2%c of yer points\n\r",37);*/
  242.         news_post(user_on->say_loose,user_on->name,en_name,5);
  243.         user_on->money=0;
  244.         user_on->alive=UNCONCIOUS;
  245.         points_loose(user_on->points*.02);
  246.  
  247.         WaitForEnter();
  248.         od_exit(10,FALSE);
  249.           }
  250.  
  251.         }
  252.       } else if (key=='G') {
  253.         intval=random(2);
  254.         if (intval==0) {
  255.  
  256.           ny_line(212,2,1);
  257.           //od_printf("\n\r\n`bright red`Y`red`a got away ...\n\r");
  258.  
  259.           if(!rip)
  260.         WaitForEnter();
  261.           else
  262.         od_get_answer("\n\r");
  263.           return;
  264.         } else {
  265.  
  266.           ny_line(213,2,1);
  267.           //od_printf("\n\r\n`bright red`Y`red`e couldn't find a way outta this ...\n\r");
  268.  
  269. //          randomize();
  270.           en_hit_s = en_strength * (what_arm_force(en_arm)) * (double)((random(75)+75)/100.0);
  271.           def_s = user_on->defense * what_drug_force_d(user_on->drug,user_on->drug_high) * (double)((random(80)+140)/100.0);
  272.           def_s*=pow(1.2,user_on->level);
  273.           def_s*=(100.0-(user_on->since_got_laid*2))/100.0;
  274.           if (user_on->drug>=COKE) def_s-=random(user_on->drug_days_since * pow(user_on->drug_addiction,1.2))/60;
  275.           if (def_s<0) def_s=0;
  276.           def_s/=2;
  277.           en_hit_s-=def_s;
  278.           if (en_hit_s<0) en_hit_s=0;
  279.  
  280.  
  281.           ny_disp_emu("\n\r\n`0");
  282.           ny_disp_emu(en_name);
  283.           ny_line(211,0,0);
  284.           //od_printf(" `red`kicks yer ass fer `bright green`
  285.           od_printf(D_Num(en_hit_s));
  286.           ny_line(210,0,0);
  287.  
  288.           user_on->hitpoints-=en_hit_s;
  289.           wrt_sts();
  290.           if (user_on->hitpoints<=0) {
  291.         //od_printf("\n\r\n`bright`");
  292.         od_printf("\n\r\n");
  293.         ny_send_menu(ASS_KICKED,"");
  294.  
  295.         /*od_printf("You had yer ass kicked ... oh well that happens\n\rCome back tomorrow to get revenge ...\n\r");
  296.         od_printf("You lost all the money on ya...");
  297.         od_printf("\n\rAnd 2%c of yer points\n\r",37);*/
  298.  
  299.  
  300.         news_post(user_on->say_loose,user_on->name,en_name,5);
  301.         user_on->alive=UNCONCIOUS;
  302.         user_on->money=0;
  303.         points_loose(user_on->points*.02);
  304.         //wrt_sts();
  305.         WaitForEnter();
  306.         od_exit(10,FALSE);
  307.           }
  308.  
  309.         }
  310.       } else {
  311.         DisplayStats();
  312.         WaitForEnter();
  313.       }
  314.     } while (en_hitpoints>0);
  315. //    od_printf("\n\r\n%ld\n\r\n",intval);
  316. //    intval=(long)enhitp*.2+ randomf((long)enhitp*.2);
  317. //    od_printf("\n\r\n%ld\n\r\n",intval);
  318. /*    intval=((long)user_on->level*.55 + 1)*((long)enhitp*.5+ randomf((long)enhitp*.5))+(long)(3*(user_on->level+1));
  319.     if ((long)intval<(long)enhitp) intval=(long)enhitp;
  320.     money_plus((unsigned long)intval);
  321.     wrt_sts();*/
  322.  
  323.  
  324.     ny_line(214,2,0);
  325. //    od_printf("\n\r\n`bright red`Y`red`ou kicked `bright green`");
  326.     ny_disp_emu(en_name);
  327.     ny_line(215,0,1);
  328. //    od_printf("'s `red`ass ...\n\r\n");
  329. //    ny_line(216,0,0);
  330. //    od_printf("`bright red`Y`red`a find `bright red`
  331. //    od_printf(D_Num(intval));
  332. //    ny_line(217,0,0);
  333. //    `red` bucks ",D_Num(intval));
  334. //    intval=randomf((user_on->level+1)*12)+3;
  335. //    od_printf(D_Num((unsigned long)intval * (unsigned long)DrgPtsCoef()));
  336. //    ny_line(218,0,1);
  337. //    `red` points!\n\r",D_Num((unsigned long)intval * (unsigned long)DrgPtsCoef()));
  338. //    points_raise(intval);
  339.  
  340.     WaitForEnter();
  341. } // end of function attack_ops
  342.  
  343. /*char
  344. fight(int exp)
  345. {
  346.     char allowed[]="LHYTQ?\n\r";
  347.  
  348.     char key;  // Menu choice
  349.  
  350.  
  351.     od_clear_keybuffer();
  352.  
  353.        if(no_rip_m!=1){
  354.     od_printf("\n\r\n");
  355.     if (exp!=2 && exp!=3) ny_clr_scr();            // Prepare virgin screen
  356.  
  357.     if ((exp==2 || exp==3) && rip==FALSE) {
  358. //      ny_dispod_printf("\n\r`bright red`S`red`treet `bright red`F`red`ights\n\r");
  359.       ny_line(353,0,1);
  360.       //ny_disp_emu("\n\r`@S`4treet `@F`4ights\n\r`0");
  361.       od_printf(allowed);
  362.       ny_line(36,0,0);
  363.       od_printf("%d ",od_control.caller_timelimit);
  364.       ny_line(37,0,0);
  365.  
  366.       //od_printf("`bright green`%s`bright blue`E`blue`nter `bright blue`Y`blue`er `bright blue`C`blue`ommand (%d mins)`bright blue`>",allowed,od_control.caller_timelimit);
  367.       if(rip) od_disp_str("\n\r!|10$HKEYON$|#|#|#\n\r");
  368.       key=ny_get_answer(allowed);
  369.       if(rip) od_disp_str("\n\r!|10$HKEYOFF$|#|#|#\n\r");
  370.     } else {// if((key = od_hotkey_menu("SFIGHT", allowed, TRUE)) == 0) {
  371.  
  372.     // Print menu and command line
  373.     if(!rip) {
  374.       ny_line(353,1,2);
  375.       //ny_disp_emu("\n\r`@S`4treet `@F`4ights\n\r\n");
  376.       disp_fig_stats();
  377.     }
  378.     key=ny_send_menu(S_FIG,allowed);
  379.  
  380.  
  381.  
  382. /*    od_printf("`green`-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n\r");
  383.  
  384.     key=od_get_key(FALSE);
  385.     if (key>='a' && key<='z') key-=32;
  386.     if (key!=0 && strchr(allowed,key)!=NULL) goto s_f_after;
  387.     od_printf("`bright blue`So you wanna kick some ass ....\n\r\n");
  388.     key=od_get_key(FALSE);
  389.     if (key>='a' && key<='z') key-=32;
  390.     if (key!=0 && strchr(allowed,key)!=NULL) goto s_f_after;
  391.     od_printf("     `bright red`L`red` - Look for Ass to kick  `bright red`H`red` - Heal wounds\n\r");
  392.     key=od_get_key(FALSE);
  393.     if (key>='a' && key<='z') key-=32;
  394.     if (key!=0 && strchr(allowed,key)!=NULL) goto s_f_after;
  395.     od_printf("     `bright red`Y`red` - Your Stats            `bright red`T`red` - Take a drug\n\r");
  396.     key=od_get_key(FALSE);
  397.     if (key>='a' && key<='z') key-=32;
  398.     if (key!=0 && strchr(allowed,key)!=NULL) goto s_f_after;
  399.     od_printf("     `bright red`Q`red` - Return to Central Park\n\r\n");
  400.     key=od_get_key(FALSE);
  401.     if (key>='a' && key<='z') key-=32;
  402.     if (key!=0 && strchr(allowed,key)!=NULL) goto s_f_after;-/
  403.  
  404. //    ny_disp_emu("`9E`1nter `9Y`1er `9C`1ommand (`9");
  405.  //    od_printf("%d ",od_control.caller_timelimit);
  406.    //    ny_disp_emu("`1mins)`9>");
  407.     if(!rip){
  408.       ny_line(36,0,0);
  409.       od_printf("%d ",od_control.caller_timelimit);
  410.       ny_line(37,0,0);
  411.     }
  412.  
  413. //    s_f_after:;
  414.  
  415.     if (key==0) {
  416.       if(rip) od_disp_str("\n\r!|10$HKEYON$|#|#|#\n\r");
  417.       key = ny_get_answer(allowed);
  418.       if(rip) od_disp_str("\n\r!|10$HKEYOFF$|#|#|#\n\r");
  419.     }
  420.     }
  421.  
  422.        } else {
  423.     no_rip_m=0;
  424.     if(rip) od_disp_str("\n\r!|10$HKEYON$|#|#|#\n\r");
  425.     key=ny_get_answer(allowed);
  426.     if(rip) od_disp_str("\n\r!|10$HKEYOFF$|#|#|#\n\r");
  427.        }
  428.  
  429.     // If enter or line feed, quit the menu -- default choice
  430.     if (key=='\n' || key=='\r') key='Q';
  431.  
  432.     // Print the choice
  433.     if(!rip) od_putch(key);
  434.     if(expert==1) expert=3;
  435.  
  436.     // return the choice
  437.     return key;
  438. } // End of fight menu function
  439. */
  440.  
  441.  
  442.  
  443.  
  444.  
  445. void
  446. fight_ops(user_rec *cur_user)  //This function operates the fights with monsters
  447. {
  448.  
  449.     char key;  // Menu choice
  450.     int intval;
  451.  
  452.     //user_rec cur_user; // The User Record Variable
  453.     //cur_user *user_on;  // declare allias for the user record
  454.  
  455.     do {
  456.         //key = fight(expert);  //Getting the result of menu choice
  457.         key=callmenu("LHYTQ?\n\r",S_FIG,353,TRUE);
  458.         while (key=='?') {
  459.           expert+=10;
  460.           key=callmenu("LHYTQ?\n\r",S_FIG,353,TRUE);
  461.           expert-=10;
  462.         }
  463.  
  464.  
  465.  
  466.         if (key == 'L') {
  467.           attack_ops(cur_user);
  468.         } // End of if look
  469.         else if (key == 'T') {  // Take drugs
  470.           take_drug();
  471.         } // End of take drug
  472.         else if (key == 'H') {
  473.         ny_line(199,2,0);
  474.         if(rip)
  475.           od_get_answer("\n\r");
  476.         //od_printf("\n\r\n`bright red`Y`red`a enter the hospital ...\n\r");
  477.         heal_wounds();
  478.         } // End of healing
  479.         else if (key == 'Y') {
  480.         DisplayStats();
  481.         WaitForEnter();
  482.         } // End of viewing the stats
  483.  
  484.     } while (key != 'Q');   // Do until quit encountered
  485. }   // end of fight_ops function
  486.  
  487.  
  488.  
  489. void attack_ops(user_rec *user_on)
  490. {
  491.     long hit_s; //the attacking stregth
  492.     long def_s;
  493.     long en_hit_s;
  494.     long en_def_s;
  495.  
  496.     FILE *justfile;
  497.     //enemy_idx eidx;
  498.     int first,last;//,moneis;
  499.     long intval;
  500.     enemy erec;
  501.     char key;
  502.  
  503.     if (user_on->turns <= 0) {
  504.  
  505.       ny_line(200,2,1);
  506.       //od_printf("\n\r\n`bright red`Y`red`a ain't got no fights left ... come back tomorrow\n\r");
  507.  
  508.  
  509.       if(!rip)
  510.         WaitForEnter();
  511.       else {
  512.         od_get_answer("\n\r");
  513.         no_rip_m=1;
  514.       }
  515.       return;
  516.     }
  517.  
  518.     if(expert==3) expert=1;
  519.  
  520.     intval=event_gen(user_on);
  521.     if (intval==1){
  522.       if(rip) no_rip_m=1;
  523.       return;
  524.     }
  525.     if (intval==2) {
  526.       if(rip) no_rip_m=1;
  527.       user_on->turns--;
  528.       return;
  529.     }
  530.  
  531.     user_on->turns--;
  532.     wrt_sts();
  533.  
  534.     //readin the index
  535.     ch_game_d();
  536.     justfile=ShareFileOpen(ENEMY_INDEX,"rb");
  537.     fseek(justfile,(long)user_on->level*2,SEEK_SET);
  538.     ny_fread(&first,2,1,justfile);
  539.     fseek(justfile,(long)user_on->level*2 + 42,SEEK_SET);
  540.     ny_fread(&last,2,1,justfile);
  541.  
  542.     fclose(justfile);
  543.  
  544.     intval=random(last-first+1)+first;
  545.  
  546.     justfile=ShareFileOpen(ENEMY_FILENAME,"rb");
  547.     fseek(justfile,(long)intval*sizeof(enemy),SEEK_SET);
  548.     ny_fread(&erec,sizeof(enemy),1,justfile);
  549.     fclose(justfile);
  550.  
  551.     od_printf("\n\r\n");
  552.  
  553.     ny_clr_scr();
  554.  
  555.  
  556.     ny_line(201,0,0);
  557. //    You meet
  558.     ny_disp_emu(erec.name);
  559.     ny_line(202,0,2);
  560. //     ...
  561.     ny_line(203,0,0);
  562. //    H`4e got a bad lokin' `0");
  563.     print_arm(erec.arm);
  564.  
  565.  
  566.     long enhitp;
  567.     enhitp=erec.hitpoints;
  568.  
  569.     do {
  570.  
  571.       bam_nf:
  572.  
  573.       ny_line(204,3,2);
  574. //      ny_disp_emu("\n\r\n\n\r`@S`4treet `@F`4ight\n\r\n`0");
  575.       ny_disp_emu(erec.name);
  576.       ny_line(205,0,0);
  577. //      ny_disp_emu("'s `@H`4itpoints:");
  578.       od_printf("%s",D_Num(erec.hitpoints));
  579.       ny_line(206,1,0);
  580. //      ny_disp_emu("\n\r`@Y`4er `@H`4itpoints: ");
  581.       od_printf("%s\n\r\n",D_Num(user_on->hitpoints));
  582. /*      ny_disp_emu("\n\r\n`@[A] `4- `@A`4ttack\n\r");
  583.       ny_disp_emu("`@[T] `4- `@T`4ake `@D`4rug `@A`4nd `@A`4ttack\n\r");
  584.       ny_disp_emu("`@[G] `4- `@G`4et `@O`4utta `@H`4ere\n\r");
  585.       ny_disp_emu("`@[Y] `4- `@Y`4er `@S`4tats\n\r");*/
  586.       ny_send_menu(ATTACK,"");
  587.       ny_line(207,1,0);
  588.       //ny_disp_emu("\n\r`@W`4hat ya gonna do? (`@[A] T G Y`4)");
  589.  
  590.       key=od_get_answer("ATKPRGY\n\r");
  591.       if (key=='\n' || key=='\r') key='A';
  592.  
  593.       od_putch(key);
  594.  
  595.       if(key=='R' && user_on->rocks==0) {
  596.         ny_line(445,2,1);
  597.         WaitForEnter();
  598.         goto bam_nf;
  599.       }
  600.  
  601.  
  602.       if (key == 'T') {  // Take drugs
  603.         take_drug();
  604.         no_rip_m=0;
  605.         key='A';
  606.       }
  607.       if (key=='A' || key=='K' || key=='P' || key=='R') {
  608.         // when atacking
  609. //        randomize();
  610.         if(key=='K') {
  611.           hit_s=random(150 - user_on->kick_ability);
  612.           if(hit_s<35) {
  613.         hit_s = (long)user_on->strength * (pow((user_on->level/2)+2,1.2)*6.0*(user_on->kick_ability/100.0)) * (double)((random(80)+90)/100.0);
  614.         ny_line(439,2,0);
  615.           } else {
  616.         hit_s=0;
  617.         ny_line(440,2,0);
  618.           }
  619.         } else if(key=='P') {
  620.           hit_s=random(140 - user_on->punch_ability);
  621.           if(hit_s<35) {
  622.         hit_s = (long)user_on->strength * (pow((user_on->level/2)+1,1.2)*6.0*(user_on->punch_ability/90.0)) * (double)((random(80)+90)/100.0);
  623.         ny_line(441,2,0);
  624.           } else {
  625.         hit_s=0;
  626.         ny_line(442,2,0);
  627.           }
  628.         } else if(key=='R') {
  629.           hit_s=random(145 - user_on->throwing_ability);
  630.           user_on->rocks--;
  631.           if(hit_s<35) {
  632.         hit_s = (long)user_on->strength * (pow((user_on->level/2)+2,1.2)*6.0*(user_on->throwing_ability/110.0)) * (double)((random(80)+90)/100.0);
  633.         ny_line(443,2,0);
  634.           } else {
  635.         hit_s=0;
  636.         ny_line(444,2,0);
  637.           }
  638.         }
  639.  
  640.         attack_again_s:;
  641.         if(key=='A')
  642.           hit_s = (long)user_on->strength * (what_arm_force(user_on->arm)) * (double)((random(80)+90)/100.0);
  643.         // If he is on drugs
  644.         if(user_on->drug_high > 0)
  645.           hit_s = (hit_s * what_drug_force_a(user_on->drug,user_on->drug_high));
  646.  
  647. //        hit_s*=pow(1.1,user_on->level);
  648.  
  649.         hit_s*=(100.0-(user_on->since_got_laid*2))/100.0;
  650.         if (user_on->drug>=COKE) hit_s-=random(user_on->drug_days_since * pow((double)user_on->drug_addiction,1.2))/60;
  651.         if (hit_s<0) hit_s=0;
  652.  
  653.         en_hit_s = erec.strength * (what_arm_force(erec.arm)) * (double)((random(75)+60)/100.0);
  654.  
  655.         def_s = user_on->defense * what_drug_force_d(user_on->drug,user_on->drug_high) * (double)((random(80)+140)/100.0);
  656.         def_s*=pow(1.2,user_on->level);
  657.         def_s*=(100.0-(user_on->since_got_laid*2))/100.0;
  658.         if (user_on->drug>=COKE) def_s-=random(user_on->drug_days_since * pow(user_on->drug_addiction,1.2))/60;
  659.         if (def_s<0) def_s=0;
  660.  
  661.         en_def_s = erec.defense * (double)((random(75)+50)/100.0);
  662.  
  663.         def_s/=2;
  664.         en_def_s/=2;
  665.  
  666.         en_hit_s-=def_s;
  667.         if (en_hit_s<0) en_hit_s=0;
  668.  
  669.         hit_s-=en_def_s;
  670.         if (hit_s<0) hit_s=0;
  671.  
  672.         if (hit_s==0 && en_hit_s==0 && key=='A') goto attack_again_s;
  673.  
  674.         erec.hitpoints-=hit_s;
  675.  
  676.  
  677.         ny_line(208,2,0);
  678. //        od_printf("\n\r\n`bright red`Y`red`a kick `bright green`");
  679.         ny_disp_emu(erec.name);
  680.         ny_line(209,0,0);
  681. //        od_printf("'s `red`ass fer `bright green`
  682.         od_printf(D_Num(hit_s));
  683.         ny_line(210,0,0);
  684. //        %s `red`damage",D_Num(hit_s));
  685.  
  686.  
  687.         if (erec.hitpoints>0) {
  688.  
  689.           ny_disp_emu("\n\r\n`0");
  690.           ny_disp_emu(erec.name);
  691.  
  692.           ny_line(211,0,0);
  693.           //od_printf(" `red`kicks yer ass fer `bright green`
  694.           od_printf(D_Num(en_hit_s));
  695.           ny_line(210,0,0);
  696.           user_on->hitpoints-=en_hit_s;
  697.           wrt_sts();
  698.           if (user_on->hitpoints<=0) {
  699.         od_printf("\n\r\n");
  700.         ny_send_menu(ASS_KICKED,"");
  701. /*        od_printf("You had yer ass kicked ... oh well that happens\n\rCome back tomorrow to get revenge ...\n\r");
  702.         od_printf("You lost all the money on ya...");
  703.         od_printf("\n\rAnd 2%c of yer points\n\r",37);*/
  704.         news_post(user_on->say_loose,user_on->name,erec.name,5);
  705.         user_on->money=0;
  706.         user_on->alive=UNCONCIOUS;
  707.         points_loose(user_on->points*.02);
  708.  
  709.         WaitForEnter();
  710.         od_exit(10,FALSE);
  711.           }
  712.  
  713.         }
  714.       } else if (key=='G') {
  715.         intval=random(2);
  716.         if (intval==0) {
  717.  
  718.           ny_line(212,2,1);
  719.           //od_printf("\n\r\n`bright red`Y`red`a got away ...\n\r");
  720.  
  721.           if(!rip)
  722.         WaitForEnter();
  723.           else
  724.         od_get_answer("\n\r");
  725.           return;
  726.         } else {
  727.  
  728.           ny_line(213,2,1);
  729.           //od_printf("\n\r\n`bright red`Y`red`e couldn't find a way outta this ...\n\r");
  730.  
  731. //          randomize();
  732.           en_hit_s = erec.strength * (what_arm_force(erec.arm)) * (double)((random(75)+75)/100.0);
  733.           def_s = user_on->defense * what_drug_force_d(user_on->drug,user_on->drug_high) * (double)((random(80)+140)/100.0);
  734.           def_s*=pow(1.2,user_on->level);
  735.           def_s*=(100.0-(user_on->since_got_laid*2))/100.0;
  736.           if (user_on->drug>=COKE) def_s-=random(user_on->drug_days_since * pow(user_on->drug_addiction,1.2))/60;
  737.           if (def_s<0) def_s=0;
  738.           def_s/=2;
  739.           en_hit_s-=def_s;
  740.           if (en_hit_s<0) en_hit_s=0;
  741.  
  742.  
  743.           ny_disp_emu("\n\r\n`0");
  744.           ny_disp_emu(erec.name);
  745.           ny_line(211,0,0);
  746.           //od_printf(" `red`kicks yer ass fer `bright green`
  747.           od_printf(D_Num(en_hit_s));
  748.           ny_line(210,0,0);
  749.  
  750.           user_on->hitpoints-=en_hit_s;
  751.           wrt_sts();
  752.           if (user_on->hitpoints<=0) {
  753.         //od_printf("\n\r\n`bright`");
  754.         od_printf("\n\r\n");
  755.         ny_send_menu(ASS_KICKED,"");
  756.  
  757.         /*od_printf("You had yer ass kicked ... oh well that happens\n\rCome back tomorrow to get revenge ...\n\r");
  758.         od_printf("You lost all the money on ya...");
  759.         od_printf("\n\rAnd 2%c of yer points\n\r",37);*/
  760.  
  761.  
  762.         news_post(user_on->say_loose,user_on->name,erec.name,5);
  763.         user_on->alive=UNCONCIOUS;
  764.         user_on->money=0;
  765.         points_loose(user_on->points*.02);
  766.         //wrt_sts();
  767.         WaitForEnter();
  768.         od_exit(10,FALSE);
  769.           }
  770.  
  771.         }
  772.       } else {
  773.         DisplayStats();
  774.         WaitForEnter();
  775.       }
  776.     } while (erec.hitpoints>0);
  777. //    od_printf("\n\r\n%ld\n\r\n",intval);
  778. //    intval=(long)enhitp*.2+ randomf((long)enhitp*.2);
  779. //    od_printf("\n\r\n%ld\n\r\n",intval);
  780.     intval=((long)user_on->level*.55 + 1)*((long)enhitp*.5+ randomf((long)enhitp*.5))+(long)(3*(user_on->level+1));
  781.     if ((long)intval<(long)enhitp) intval=(long)enhitp;
  782.     money_plus((unsigned long)intval);
  783.     wrt_sts();
  784.  
  785.  
  786.     ny_line(214,2,0);
  787. //    od_printf("\n\r\n`bright red`Y`red`ou kicked `bright green`");
  788.     ny_disp_emu(erec.name);
  789.     ny_line(215,0,2);
  790. //    od_printf("'s `red`ass ...\n\r\n");
  791.     ny_line(216,0,0);
  792. //    od_printf("`bright red`Y`red`a find `bright red`
  793.     od_printf(D_Num(intval));
  794.     ny_line(217,0,0);
  795. //    `red` bucks ",D_Num(intval));
  796.     intval=randomf((user_on->level+1)*12)+3;
  797.     od_printf(D_Num((unsigned long)intval * (unsigned long)DrgPtsCoef()));
  798.     ny_line(218,0,1);
  799. //    `red` points!\n\r",D_Num((unsigned long)intval * (unsigned long)DrgPtsCoef()));
  800.     points_raise(intval);
  801.  
  802.     WaitForEnter();
  803. } // end of function attack_ops
  804.  
  805. void
  806. fgc(int *enm_num, int *user_num)
  807. {
  808.   char numstr[21];
  809.   int intval;
  810. //  ffblk ffblk;
  811.   FILE *justfile;
  812.  
  813.   sprintf(numstr,"u%07d.fgc",*user_num);
  814.   if (findfirst(numstr,&fff,0)==0) {
  815.     justfile=ShareFileOpen(numstr,"rb");
  816.     ny_fread(enm_num,2,1,justfile);
  817.     fclose(justfile);
  818.   }
  819. }
  820.  
  821.  
  822. void
  823. sfflg(int user_num,char numstr[], int enm_num, user_rec *erec)
  824. {
  825.   ch_flag_d();
  826.   FILE *justfile;
  827.  
  828.   sprintf(numstr,"u%07d.fgg",user_num); //set fight flag
  829.   justfile = ShareFileOpen(numstr, "wb");
  830.   fclose(justfile);
  831.  
  832.   //readin the enemy record
  833.   sprintf(numstr,"u%07d.sts",enm_num);
  834.   justfile=ShareFileOpen(numstr,"rb");
  835.   ny_fread(erec,sizeof(user_rec),1,justfile);
  836.   fclose(justfile);
  837. }
  838.  
  839. int
  840. fig_m(user_rec *erec, user_rec *user_on, int *enm_num, int *user_num)
  841. {
  842. char key;
  843. unsigned long intval;
  844. char numstr[25];
  845. char numstr2[25];
  846. FILE *justfile;
  847. long hit_s,def_s,en_hit_s;
  848. time_t t,t2;
  849.  
  850.  
  851.  
  852.     do {
  853.  
  854.       bam_ofm:
  855.       ny_line(221,3,0);
  856. //      od_printf("\n\r\n\n\r`bright red`O`red`nline `bright red`P`red`layer `bright red`F`red`ight");
  857.       ny_disp_emu("\n\r\n`0");
  858.       ny_disp_emu(erec->name);
  859.       ny_line(205,0,0);
  860. //      od_printf("'s `bright red`H`red`itpoints: %s",
  861.       od_printf(D_Num(erec->hitpoints));
  862.       ny_line(206,1,0);
  863. //      od_printf("\n\r`bright red`Y`red`er `bright red`H`red`itpoints: %s",
  864.     od_printf(D_Num(user_on->hitpoints));
  865.       od_printf("\n\r\n");
  866. /*      od_printf("\n\r\n`bright red`[A] `red`- `bright red`A`red`ttack\n\r");
  867.       od_printf("`bright red`[T] `red`- `bright red`T`red`ake `bright red`D`red`rug `bright red`A`red`nd `bright red`A`red`ttack\n\r");
  868.       od_printf("`bright red`[G] `red`- `bright red`G`red`et `bright red`O`red`utta `bright red`H`red`ere\n\r");
  869.       od_printf("`bright red`[Y] `red`- `bright red`Y`red`er `bright red`S`red`tats\n\r");
  870.       od_printf("\n\r`bright red`W`red`hat ya gonna do? (`bright red`[A] G Y`red`)");*/
  871.       ny_send_menu(ATTACK,"");
  872.       ny_line(207,1,0);
  873. //      ny_disp_emu("\n\r`@W`4hat ya gonna do? (`@[A] T G Y`4)");
  874.  
  875.  
  876.       key=od_get_answer("ATKPRGY\n\r");
  877.       if (key=='\n' || key=='\r') key='A';
  878.       od_putch(key);
  879.       fgc(enm_num,user_num);
  880.       if (key=='Y') {
  881.     DisplayStats();
  882.     ny_line(1,1,0);
  883.     od_get_answer("\n\r");
  884.       }
  885.     } while (key=='Y');
  886.  
  887.     if(key=='R' && user_on->rocks==0) {
  888.      ny_line(445,2,1);
  889.      ny_line(1,1,0);
  890.      od_get_answer("\n\r");
  891.      goto bam_ofm;
  892.    }
  893.  
  894.  
  895.    if (key == 'T') {  // Take drugs
  896.      take_drug();
  897.      no_rip_m=0;
  898.      key='A';
  899.    }
  900.    if (key=='A' || key=='K' || key=='P' || key=='R') {
  901.      // when atacking
  902. //   randomize();
  903.      if(key=='K') {
  904.        hit_s=random(150 - user_on->kick_ability);
  905.        if(hit_s<35) {
  906.      hit_s = (long)user_on->strength * (pow((user_on->level/2)+2,1.2)*6.0*(user_on->kick_ability/100.0)) * (double)((random(80)+90)/100.0);
  907.      ny_line(439,2,0);
  908.        } else {
  909.      hit_s=0;
  910.      ny_line(440,2,0);
  911.        }
  912.      } else if(key=='P') {
  913.        hit_s=random(140 - user_on->punch_ability);
  914.        if(hit_s<35) {
  915.      hit_s = (long)user_on->strength * (pow((user_on->level/2)+2,1.2)*6.0*(user_on->punch_ability/90.0)) * (double)((random(80)+90)/100.0);
  916.      ny_line(441,2,0);
  917.        } else {
  918.      hit_s=0;
  919.      ny_line(442,2,0);
  920.        }
  921.      } else if(key=='R') {
  922.        hit_s=random(145 - user_on->throwing_ability);
  923.        user_on->rocks--;
  924.        if(hit_s<35) {
  925.      hit_s = (long)user_on->strength * (pow((user_on->level/2)+2,1.2)*6.0*(user_on->throwing_ability/110.0)) * (double)((random(80)+90)/100.0);
  926.      ny_line(443,2,0);
  927.        } else {
  928.      hit_s=0;
  929.      ny_line(444,2,0);
  930.        }
  931.      }
  932.  
  933.  
  934.     /*if (key == 'T') {  // Take drugs
  935.       take_drug();
  936.       no_rip_m=0;
  937.       key='A';
  938.     }
  939.     if (key=='A') {*/
  940.       // when atacking
  941. //      randomize();
  942.       if(key=='A')
  943.     hit_s = user_on->strength * (what_arm_force(user_on->arm)) * (double)((random(80)+80)/100.0);
  944.     // If he is on drugs
  945.       if(user_on->drug_high > 0)
  946.     hit_s = (hit_s * what_drug_force_a(user_on->drug,user_on->drug_high));
  947.  
  948. //      hit_s*=pow(1.1,user_on->level);
  949.  
  950.       hit_s*=(100.0-(user_on->since_got_laid*2))/100.0;
  951.       if (user_on->drug>=COKE) hit_s-=random(user_on->drug_days_since * pow((double)user_on->drug_addiction,1.2))/60;
  952.       if (hit_s<0) hit_s=0;
  953.  
  954.       def_s = user_on->defense * what_drug_force_d(user_on->drug,user_on->drug_high) * (double)((random(80)+140)/100.0);
  955.       def_s*=pow(1.2,user_on->level);
  956.       def_s*=(100.0-(user_on->since_got_laid*2))/100.0;
  957.       if (user_on->drug>=COKE) def_s-=random(user_on->drug_days_since * pow(user_on->drug_addiction,1.2))/60;
  958.       if (def_s<0) def_s=0;
  959.  
  960.       def_s/=2;
  961.  
  962.       sprintf(numstr,"u%07d.atk",*enm_num);
  963.       justfile = ShareFileOpen(numstr, "wb");
  964.       ny_fwrite(&hit_s,4,1,justfile);
  965.       fclose(justfile);
  966.       sprintf(numstr,"u%07d.atk",*enm_num);
  967.       sprintf(numstr2,"u%07d.on",*enm_num);
  968.       ny_line(222,2,1);
  969.       //od_printf("\n\r\n`bright red`W`red`aiting....\n\r");
  970.       t=time(NULL);
  971.       t2=t;
  972.  
  973.       while ((findfirst(numstr,&fff,0)==0) && (findfirst(numstr2,&fff,0)==0)){
  974.     fgc(enm_num,user_num);
  975.     sprintf(numstr,"u%07d.atk",*enm_num);
  976.     sprintf(numstr2,"u%07d.on",*enm_num);
  977.     while(t==t2) {
  978.       t=time(NULL);
  979.       od_kernal();
  980.     }
  981.     t2=t;
  982.     od_kernal();
  983.       }
  984.  
  985.       if (findfirst(numstr2,&fff,0)!=0) {
  986.  
  987.     ny_line(223,2,1);
  988.     if(rip) od_get_answer("\n\r");
  989.     ny_line(224,0,1);
  990.     //od_printf("\n\r\n`bright red`Y`red`er enemy droped carrier on ya!\n\r`bright red`G`red`o and kill him offline\n\r");
  991.  
  992.     ny_remove(numstr);
  993.     //sprintf(numstr,"del u%07d.atk",*enm_num);
  994.     //system(numstr);
  995.     sprintf(numstr,"u%07d.fgg",*user_num);
  996.     ny_remove(numstr);
  997.     if(!rip) ny_line(1,1,0);
  998.     od_get_answer("\n\r");
  999.     return TRUE;
  1000.       }
  1001.  
  1002.       intval=erec->hitpoints;
  1003.  
  1004.       sprintf(numstr,"u%07d.sts",*enm_num);
  1005.       justfile=ShareFileOpen(numstr,"rb");
  1006.       ny_fread(erec,sizeof(user_rec),1,justfile);
  1007.       fclose(justfile);
  1008.  
  1009.       intval -= erec->hitpoints;
  1010.  
  1011.       fgc(enm_num,user_num);
  1012.  
  1013.  
  1014.       ny_line(208,2,0);
  1015.       //od_printf("\n\r\n`bright red`Y`red`a kick `bright green`");
  1016.       ny_disp_emu(erec->name);
  1017.       ny_line(209,0,0);
  1018.       od_printf(D_Num(intval));
  1019.       ny_line(210,0,0);
  1020.  
  1021.      } else if (key=='G') {
  1022.        intval=random(2);
  1023.        if (intval==0) {
  1024.  
  1025.      ny_line(212,2,1);
  1026.   //     od_printf("\n\r\n`bright red`Y`red`a got away ...\n\r");
  1027.  
  1028.      sprintf(numstr,"u%07d.atk",*enm_num);
  1029.      justfile = ShareFileOpen(numstr, "wb");
  1030.      intval=-1; //user got away
  1031.      ny_fwrite(&intval,4,1,justfile);
  1032.      fclose(justfile);
  1033.      sprintf(numstr,"u%07d.fgg",*user_num);
  1034.      ny_remove(numstr);
  1035.      if(!rip) ny_line(1,1,0);
  1036.      od_get_answer("\n\r");
  1037.      return TRUE;
  1038.        } else {
  1039.  
  1040.      ny_line(213,2,1);
  1041. //     od_printf("\n\r\n`bright red`Y`red`e couldn't find a way outta this ...\n\r");
  1042.  
  1043.      sprintf(numstr,"u%07d.atk",*enm_num);
  1044.      justfile = ShareFileOpen(numstr, "wb");
  1045.      intval=-2; ///user couldn't get away
  1046.      ny_fwrite(&intval,4,1,justfile);
  1047.      fclose(justfile);
  1048.      sprintf(numstr,"u%07d.atk",*enm_num);
  1049.      sprintf(numstr2,"u%07d.on",*enm_num);
  1050.  
  1051.      ny_line(222,2,1);
  1052.      //od_printf("\n\r\n`bright red`W`red`aiting....\n\r");
  1053.  
  1054.      t=time(NULL);
  1055.      t2=t;
  1056.      while ((findfirst(numstr,&fff,0)==0) && (findfirst(numstr2,&fff,0)==0)){
  1057.        fgc(enm_num,user_num);
  1058.        sprintf(numstr,"u%07d.atk",*enm_num);
  1059.        sprintf(numstr2,"u%07d.on",*enm_num);
  1060.        while(t==t2) {
  1061.          t=time(NULL);
  1062.          od_kernal();
  1063.        }
  1064.        t2=t;
  1065.        od_kernal();
  1066.      }
  1067.  
  1068.      if (findfirst(numstr2,&fff,0)!=0) {
  1069.  
  1070.        ny_line(223,2,1);
  1071.        if(rip) od_get_answer("\n\r");
  1072.        ny_line(224,0,1);
  1073.        //od_printf("\n\r\n`bright red`Y`red`er enemy droped carrier on ya!\n\r`bright red`G`red`o and kill him offline\n\r");
  1074.  
  1075. //       sprintf(numstr,"del u%07d.atk",enm_num);
  1076. //       system(numstr);
  1077.        ny_remove(numstr);
  1078.        sprintf(numstr,"u%07d.fgg",*user_num);
  1079.        ny_remove(numstr);
  1080.        if(!rip) ny_line(1,1,0);
  1081.        od_get_answer("\n\r");
  1082.        return TRUE;
  1083.      }
  1084.        }
  1085.      }
  1086.      return FALSE;
  1087.  
  1088. }
  1089.  
  1090. int
  1091. o_checks(int *enm_num,int *user_num, user_rec *user_on, user_rec *erec)
  1092. {
  1093.   unsigned long intval;
  1094.   FILE *justfile;
  1095.   char numstr[25];
  1096.   char numstr2[25];
  1097.   int rape;
  1098.   long hit_s,def_s,en_hit_s;
  1099.   time_t t,t2;
  1100.   char key;
  1101.   mail_idx_type mail_idx;
  1102.  
  1103.  
  1104.       sprintf(numstr,"u%07d.atk",*user_num);
  1105.  
  1106.       ny_line(225,2,1);
  1107. //      od_printf("\n\r\n`bright red`W`red`aiting fer enemy response....\n\r");
  1108.  
  1109.  
  1110.       t=time(NULL);
  1111.       t2=t;
  1112.       sprintf(numstr2,"u%07d.on",*enm_num);
  1113.       while (findfirst(numstr,&fff,0)!=0 && findfirst(numstr2,&fff,0)==0) {
  1114.     fgc(enm_num,user_num);
  1115.     sprintf(numstr2,"u%07d.on",*enm_num);
  1116.     sprintf(numstr,"u%07d.atk",*user_num);
  1117.     while(t==t2) {
  1118.       t=time(NULL);
  1119.       od_kernal();
  1120.     }
  1121.     t2=t;
  1122.     od_kernal();
  1123.       }
  1124.       fgc(enm_num,user_num);
  1125.       if (findfirst(numstr2,&fff,0)!=0) {
  1126.  
  1127.     ny_line(223,2,1);
  1128.     if(rip) od_get_answer("\n\r");
  1129.     ny_line(224,0,1);
  1130. //    od_printf("\n\r\n`bright red`Y`red`er enemy droped carrier on ya!\n\r`bright red`G`red`o and kill him offline\n\r");
  1131.  
  1132.     sprintf(numstr,"u%07d.fgg",*user_num);
  1133.     ny_remove(numstr);
  1134.     if(!rip)
  1135.       ny_line(1,1,0);
  1136.     od_get_answer("\n\r");
  1137.     return TRUE;
  1138.       }
  1139.  
  1140.       //read atack file
  1141.       sprintf(numstr,"u%07d.atk",*user_num);
  1142.       justfile = ShareFileOpen(numstr, "rb");
  1143.       ny_fread(&en_hit_s,4,1,justfile);
  1144.       fclose(justfile);
  1145.  
  1146.       if (en_hit_s==-1) {
  1147.  
  1148.     ny_line(226,2,1);
  1149. //    od_printf("\n\r\n`bright red`Y`red`er enemy ran away in fear...\n\r");
  1150.  
  1151.     ny_remove(numstr);
  1152.     sprintf(numstr,"u%07d.fgg",*user_num);
  1153.     ny_remove(numstr);
  1154.     //sprintf(numstr,"del u%07d.atk",*user_num);
  1155.     //system(numstr); //see above!
  1156.     if(!rip)
  1157.       ny_line(1,1,0);
  1158.     od_get_answer("\n\r");
  1159.     return TRUE;
  1160.       }
  1161.       if (en_hit_s==-9) {
  1162.  
  1163.     ny_line(227,2,2);
  1164. //    od_printf("\n\r\n`bright red`Y`red`a `bright white`WON`red`!\n\r\n");
  1165.     sprintf(numstr,"u%07d.atk",*user_num);
  1166.     justfile = ShareFileOpen(numstr, "rb");
  1167.  
  1168.     ny_fread(&en_hit_s,4,1,justfile);
  1169.     ny_fread(&intval,4,1,justfile);
  1170.  
  1171.     fclose(justfile);
  1172.  
  1173.     money_plus(intval);
  1174.  
  1175.     ny_line(216,0,0);
  1176. //    od_printf("`bright red`Y`red`a find `bright red`
  1177.     od_printf(D_Num(intval));
  1178.     ny_line(217,0,0);
  1179.     intval=.08*erec->points;
  1180.     od_printf(D_Num((unsigned long)intval * (unsigned long)DrgPtsCoef()));
  1181.     ny_line(218,0,1);
  1182.     points_raise(intval);
  1183.  
  1184.     ny_kernel();
  1185.  
  1186.  
  1187.     //no_kernel=TRUE;
  1188.     wrt_sts();
  1189.     //no_kernel=FALSE;
  1190.  
  1191.     if (erec->arm>user_on->arm) {
  1192.  
  1193.       ny_line(228,2,0);
  1194. //      od_printf("\n\r\n`bright red`D`red`o ya wanna swap weapons with`bright green` ");
  1195.       if(!rip)
  1196.         ny_disp_emu(erec->name);
  1197.       else
  1198.         od_disp_str(ny_un_emu(erec->name,numstr));
  1199.       ny_line(79,0,0);
  1200.       //ny_disp_emu("`4? (`@Y`4/`@N`4)");
  1201.  
  1202.       key=od_get_answer("YN");
  1203.       if(!rip)
  1204.         od_printf("%c\n\r",key);
  1205.       else
  1206.         od_disp_str("\n\r");
  1207.  
  1208.       if (key=='Y') {
  1209.  
  1210.         weapon tarm;
  1211.  
  1212.         tarm=erec->arm;
  1213.         erec->arm=user_on->arm;
  1214.         user_on->arm=tarm;
  1215.         sprintf(numstr,"u%07d.on",*enm_num);
  1216.         if (findfirst(numstr,&fff,0)==0) {
  1217.           sprintf(numstr,"u%07d.swp",*enm_num);
  1218.           justfile=ShareFileOpen(numstr,"wb");
  1219.           ny_fwrite(&(erec->arm),2,1,justfile);
  1220.           fclose(justfile);
  1221.         } else {
  1222.           tarm=erec->arm;
  1223.           ch_game_d();
  1224.           justfile=ShareFileOpen(USER_FILENAME,"r+b");
  1225.           fseek(justfile,*enm_num * sizeof(user_rec),SEEK_SET);
  1226.           ny_fread(erec,sizeof(user_rec),1,justfile);
  1227.           erec->arm=tarm;
  1228.           fseek(justfile,*enm_num * sizeof(user_rec),SEEK_SET);
  1229.           ny_fwrite(erec,sizeof(user_rec),1,justfile);
  1230.           fclose(justfile);
  1231.           ch_flag_d();
  1232.         }
  1233.  
  1234.         ny_line(229,2,0);
  1235. //        od_printf("\n\r`bright red`D`red`one! `bright red`Y`red`ou now got the `bright green`");
  1236.  
  1237.         print_arm(user_on->arm);
  1238.         if(rip) {
  1239.           od_disp_str("::^M@OK))|#|#|#\n\r\n");
  1240.           od_get_answer("\n\r");
  1241.         }
  1242.         od_printf("\n\r\n");
  1243.  
  1244.       }
  1245.     }
  1246.  
  1247.     if (erec->sex!=user_on->sex && clean_mode==FALSE && user_on->sex_today>0) {
  1248.  
  1249.       ny_line(230,2,0);
  1250. //      od_printf("\n\r\n`bright red`D`red`o ya wanna rape `bright green`");
  1251.       if(!rip)
  1252.         ny_disp_emu(erec->name);
  1253.       else
  1254.         od_disp_str(ny_un_emu(erec->name,numstr));
  1255.       ny_line(79,0,0);
  1256. //      ny_disp_emu("`4? (`@Y`4/`@N`4)");
  1257.  
  1258.       key=od_get_answer("YN");
  1259.       if(!rip)
  1260.         od_printf("%c\n\r",key);
  1261.       else
  1262.         od_disp_str("\n\r");
  1263.       if (key=='Y') {
  1264.         if (user_on->sex_today<=0) {
  1265.  
  1266.           ny_line(118,2,1);
  1267.           //od_printf("\n\r\n`bright white`You already used up all your sex turns today ...\n\r");
  1268.  
  1269.           if(rip)
  1270.         od_get_answer("\n\r");
  1271.           sprintf(numstr,"u%07d.on",*enm_num);
  1272.           if (findfirst(numstr,&fff,0)==0) {
  1273.         sprintf(numstr,"u%07d.kik",*enm_num);
  1274.         justfile=ShareFileOpen(numstr,"wb");
  1275.         rape=-1;
  1276.         ny_fwrite(&rape,2,2,justfile);
  1277.         fclose(justfile);
  1278.           }
  1279. //          WaitForEnter();
  1280.         } else {
  1281.           sprintf(numstr,"u%07d.on",*enm_num);
  1282.           if (findfirst(numstr,&fff,0)==0) {
  1283.         sprintf(numstr,"u%07d.kik",*enm_num);
  1284.         justfile=ShareFileOpen(numstr,"wb");
  1285.         ny_fwrite(&user_on->std,2,1,justfile);
  1286.         ny_fwrite(&user_on->std_percent,2,1,justfile);
  1287.         fclose(justfile);
  1288.           } else {
  1289.         strcpy(mail_idx.recver,erec->name);
  1290.         strcpy(mail_idx.sender,user_on->name);
  1291.         strcpy(mail_idx.recverI,erec->bbsname);
  1292.         strcpy(mail_idx.senderI,user_on->bbsname);
  1293.         mail_idx.flirt=1000;
  1294.         mail_idx.deleted=FALSE;
  1295.         mail_idx.location=0;
  1296.         mail_idx.length=0;
  1297.         mail_idx.afterquote=0;
  1298.         mail_idx.ill=user_on->std;
  1299.         mail_idx.inf=user_on->std_percent;
  1300.         mail_idx.sender_sex=user_on->sex;
  1301.         ch_game_d();
  1302.         justfile=ShareFileOpen(MAIL_INDEX,"a+b");
  1303.         ny_fwrite(&mail_idx,sizeof(mail_idx_type),1,justfile);
  1304.         fclose(justfile);
  1305.         ch_flag_d();
  1306.           }
  1307.           user_on->since_got_laid=0;
  1308.           user_on->sex_today--;
  1309.           ny_line(339,1,0);
  1310.           if(rip)
  1311.         ny_disp_emu(erec->name);
  1312.           else
  1313.         od_disp_str(ny_un_emu(erec->name,numstr));
  1314.           ny_line(340,0,1);
  1315.           if(rip)
  1316.         od_get_answer("\n\r");
  1317.           illness(erec->std,erec->std_percent);
  1318.           points_raise((long)35*(user_on->level+1));
  1319.  
  1320. //          char omg[51];
  1321.  
  1322.          // sprintf(omg,"%s raped you after beating you ...",user_on->name);
  1323.         }
  1324.       } else {
  1325.         sprintf(numstr,"u%07d.on",*enm_num);
  1326.         if (findfirst(numstr,&fff,0)==0) {
  1327.           sprintf(numstr,"u%07d.kik",*enm_num);
  1328.           justfile=ShareFileOpen(numstr,"wb");
  1329.           rape=-1;
  1330.           ny_fwrite(&rape,2,2,justfile);
  1331.           fclose(justfile);
  1332.         }
  1333.       }
  1334.     }
  1335.  
  1336.     sprintf(numstr,"u%07d.fgg",*user_num);
  1337.     ny_remove(numstr);
  1338.  
  1339.     sprintf(numstr,"u%07d.atk",*user_num);
  1340.     ny_remove(numstr);
  1341.  
  1342.     wrt_sts();
  1343.  
  1344.     if(!rip) {
  1345.       ny_line(1,1,0);
  1346.       od_get_answer("\n\r");
  1347.     }
  1348.     return TRUE;
  1349.       }
  1350.       if (en_hit_s!=-2) {
  1351.     en_hit_s-=def_s;
  1352.     if (en_hit_s<0) en_hit_s=0;
  1353.  
  1354.     user_on->hitpoints-=en_hit_s;
  1355.     wrt_sts();
  1356.  
  1357.  
  1358.     ny_disp_emu("\n\r\n`0");
  1359.     ny_disp_emu(erec->name);
  1360.     ny_line(211,0,0);
  1361. //    od_printf(" `red`kicks yer ass fer `bright green`
  1362.     od_printf(D_Num(en_hit_s));
  1363.     ny_line(210,0,0);
  1364.  
  1365.  
  1366.     if (user_on->hitpoints <= 0) {
  1367.       sprintf(numstr,"u%07d.atk",*user_num);
  1368.       ny_remove(numstr);
  1369.       sprintf(numstr,"u%07d.atk",*enm_num);
  1370.       justfile = ShareFileOpen(numstr, "wb");
  1371.       intval=-9; //user lost
  1372.       ny_fwrite(&intval,4,1,justfile);
  1373.       intval=user_on->money; //users money
  1374.       ny_fwrite(&intval,4,1,justfile);
  1375.       fclose(justfile);
  1376.  
  1377.       od_printf("\n\r\n");
  1378.       ny_send_menu(ASS_KICKED_O,"");
  1379. /*      od_printf("\n\r\n`bright red`Y`red`a `bright white`LOST`red`!!!!\n\r");
  1380.       od_printf("`bright red`C`red`ome back tomorrow to get revenge\n\r");
  1381.       od_printf("`bright red`8%c`red` of yer points lost\n\r",37);*/
  1382.  
  1383.       user_on->alive=UNCONCIOUS;
  1384.       user_on->money=0;
  1385.       points_loose(user_on->points*.08);
  1386.       //wrt_sts();
  1387.  
  1388.       if (erec->sex!=user_on->sex) {
  1389.         sprintf(numstr,"u%07d.kik",*user_num);
  1390.         sprintf(numstr2,"u%07d.on",*enm_num);
  1391.  
  1392.         ny_line(225,2,1);
  1393. //        od_printf("\n\r\n`bright red`W`red`aiting fer enemy response....\n\r");
  1394.  
  1395.         t=time(NULL);
  1396.         t2=t;
  1397.         while (findfirst(numstr,&fff,0)!=0 && findfirst(numstr2,&fff,0)==0) {
  1398.           fgc(enm_num,user_num);
  1399.           sprintf(numstr2,"u%07d.on",*enm_num);
  1400.           sprintf(numstr,"u%07d.kik",*user_num);
  1401.           while(t==t2) {
  1402.         t=time(NULL);
  1403.         od_kernal();
  1404.           }
  1405.           t2=t;
  1406.           od_kernal();
  1407.         }
  1408.         if (findfirst(numstr,&fff,0)==0) {
  1409.           int ill;
  1410.           int inf;
  1411.  
  1412.           justfile=ShareFileOpen(numstr,"rb");
  1413.           ny_fread(&ill,2,1,justfile);
  1414.           ny_fread(&inf,2,1,justfile);
  1415.           fclose(justfile);
  1416.  
  1417.           ny_remove(numstr);
  1418.           //sprintf(numstr,"del u%07d.kik",*user_num);
  1419.           //system(numstr);
  1420.  
  1421.           if (ill!=1) {
  1422.         illness((desease)ill,inf);
  1423.  
  1424.  
  1425.         ny_disp_emu("\n\r`0");
  1426.         ny_disp_emu(erec->name);
  1427.         ny_line(232,0,1);
  1428. //        od_printf(" `red`raped ya!\n\r");
  1429.  
  1430.           }
  1431.         }
  1432.       }
  1433.  
  1434.  
  1435.       fig_ker();
  1436.       if(!rip)
  1437.         ny_line(1,1,0);
  1438.       od_get_answer("\n\r");
  1439.  
  1440.       od_exit(10,FALSE);
  1441.     }
  1442.  
  1443.     sprintf(numstr,"u%07d.atk",*user_num);
  1444.     ny_remove(numstr);
  1445.       } else {
  1446.  
  1447.     od_printf("\n\r\n`0");
  1448.     ny_disp_emu(erec->name);
  1449.     ny_line(231,2,0);
  1450. //    od_printf("\n\r\n`bright green`%s`red` tried to get away but could not ...");
  1451.  
  1452.       }
  1453.       return FALSE;
  1454. }
  1455.  
  1456.  
  1457.  
  1458. void
  1459. online_fight_a(int *user_num, user_rec *user_on, int enm_num)
  1460. {
  1461. //  mail_idx_type mail_idx;
  1462.   char numstr[25];
  1463.   char numstr2[25];
  1464. //  unsigned long intval;
  1465.   int rape;
  1466.   user_rec erec;
  1467. //  ffblk ffblk;
  1468.   FILE *justfile;
  1469.   char key;
  1470. //  long hit_s,def_s,en_hit_s;
  1471. //  time_t t,t2;
  1472.  
  1473.   sfflg(*user_num,numstr,enm_num,&erec);
  1474.  
  1475. /*  ch_flag_d();
  1476.  
  1477.   sprintf(numstr,"u%07d.fgg",*user_num); //set fight flag
  1478.   justfile = ShareFileOpen(numstr, "wb");
  1479.   fclose(justfile);
  1480.  
  1481.   //readin the enemy record
  1482.   sprintf(numstr,"u%07d.sts",enm_num);
  1483.   justfile=ShareFileOpen(numstr,"rb");
  1484.   ny_fread(&erec,sizeof(user_rec),1,justfile);
  1485.   fclose(justfile);*/
  1486.  
  1487.   sprintf(numstr,"u%07d.chl",enm_num); //set fight flag
  1488.   justfile = ShareFileOpen(numstr, "wb");
  1489.   ny_fwrite(user_num,2,1,justfile);
  1490.   fclose(justfile);
  1491.   sprintf(numstr2,"u%07d.on",enm_num);
  1492.  
  1493.   ny_line(219,2,1);
  1494. //  od_printf("\n\r\n`bright red`L`red`ookin fer yer enemy ....\n\r");
  1495.  
  1496.   key=od_get_key(FALSE);
  1497.   while ((findfirst(numstr,&fff,0)==0) && (findfirst(numstr2,&fff,0)==0) && key!='S' && key!='s') {
  1498.     key=od_get_key(FALSE);
  1499.     fgc(&enm_num,user_num);
  1500. //    sprintf(numstr2,"u%07d.on",enm_num);
  1501. //    sprintf(numstr,"u%07d.chl",enm_num);
  1502.     od_kernal();
  1503.     sleep(0);
  1504.   }
  1505.  
  1506.   if (findfirst(numstr2,&fff,0)!=0) {
  1507.  
  1508.     ny_line(220,2,1);
  1509.     //od_printf("\n\r\n`bright red`U`red`ser is not online anymore!\n\r");
  1510.  
  1511. //    sprintf(numstr,"del u%07d.chl",enm_num);
  1512. //    system(numstr);
  1513.     ny_remove(numstr);
  1514.     sprintf(numstr,"u%07d.fgg",enm_num);
  1515.     ny_remove(numstr);
  1516.     if(!rip)
  1517.       ny_line(1,1,0);
  1518.     od_get_answer("\n\r");
  1519.     return;
  1520.   }
  1521.  
  1522.   if (key=='S' || key=='s') {
  1523.  
  1524.     ny_line(337,2,1);
  1525.     //You stopped looking ...
  1526.  
  1527.     //sprintf(numstr,"del u%07d.chl",enm_num);
  1528.     //system(numstr);
  1529.     ny_remove(numstr);
  1530.     sprintf(numstr,"u%07d.fgg",enm_num);
  1531.     ny_remove(numstr);
  1532.     if(!rip)
  1533.       WaitForEnter();
  1534.     else
  1535.       od_get_answer("\n\r");
  1536.     return;
  1537.   }
  1538.  
  1539.  
  1540.  
  1541.   do {
  1542.     if(fig_m(&erec,user_on,&enm_num,user_num)) return;
  1543.     if(o_checks(&enm_num,user_num,user_on,&erec)) return;
  1544. /*   do {
  1545.  
  1546.     bam_of1:
  1547.     ny_line(221,3,0);
  1548. //    od_printf("\n\r\n\n\r`bright red`O`red`nline `bright red`P`red`layer `bright red`F`red`ight");
  1549.     ny_disp_emu("\n\r\n`0");
  1550.     ny_disp_emu(erec.name);
  1551.     ny_line(205,0,0);
  1552. //    od_printf("'s `bright red`H`red`itpoints: `0
  1553.     od_printf(D_Num(erec.hitpoints));
  1554.     ny_line(206,1,0);
  1555. //    od_printf("\n\r`bright red`Y`red`er `bright red`H`red`itpoints:
  1556.     od_printf("%s\n\r\n",D_Num(user_on->hitpoints));
  1557. /*    od_printf("\n\r\n`bright red`[A] `red`- `bright red`A`red`ttack\n\r");
  1558.     od_printf("`bright red`[T] `red`- `bright red`T`red`ake `bright red`D`red`rug `bright red`A`red`nd `bright red`A`red`ttack\n\r");
  1559.     od_printf("`bright red`[G] `red`- `bright red`G`red`et `bright red`O`red`utta `bright red`H`red`ere\n\r");
  1560.     od_printf("`bright red`[Y] `red`- `bright red`Y`red`er `bright red`S`red`tats\n\r");
  1561.     od_printf("\n\r`bright red`W`red`hat ya gonna do? (`bright red`[A] G Y`red`)");     -/
  1562.     ny_send_menu(ATTACK,"");
  1563.     ny_line(207,1,0);
  1564.     //ny_disp_emu("\n\r`@W`4hat ya gonna do? (`@[A] T G Y`4)");
  1565.  
  1566.  
  1567.     key=od_get_answer("ATKPRGY\n\r");
  1568.     if (key=='\n' || key=='\r') key='A';
  1569.     od_putch(key);
  1570.     fgc(&enm_num,user_num);
  1571.     if (key=='Y') {
  1572.       DisplayStats();
  1573.       WaitForEnter();
  1574.     }
  1575.    } while (key=='Y');
  1576.  
  1577.    if(key=='R' && user_on->rocks==0) {
  1578.      ny_line(445,2,1);
  1579.      WaitForEnter();
  1580.      goto bam_of1;
  1581.    }
  1582.  
  1583.  
  1584.    if (key == 'T') {  // Take drugs
  1585.      take_drug();
  1586.      no_rip_m=0;
  1587.      key='A';
  1588.    }*/
  1589.    /*if (key=='A' || key=='K' || key=='P' || key=='R') {
  1590.      // when atacking
  1591. //   randomize();
  1592.      if(key=='K') {
  1593.        hit_s=random(150 - user_on->kick_ability);
  1594.        if(hit_s<35) {
  1595.      hit_s = (long)user_on->strength * (pow((user_on->level/2)+2,1.2)*6.0*(user_on->kick_ability/100.0)) * (double)((random(80)+90)/100.0);
  1596.      ny_line(439,2,0);
  1597.        } else {
  1598.      hit_s=0;
  1599.      ny_line(440,2,0);
  1600.        }
  1601.      } else if(key=='P') {
  1602.        hit_s=random(140 - user_on->punch_ability);
  1603.        if(hit_s<35) {
  1604.      hit_s = (long)user_on->strength * (pow((user_on->level/2)+2,1.2)*6.0*(user_on->punch_ability/90.0)) * (double)((random(80)+90)/100.0);
  1605.      ny_line(441,2,0);
  1606.        } else {
  1607.      hit_s=0;
  1608.      ny_line(442,2,0);
  1609.        }
  1610.      } else if(key=='R') {
  1611.        hit_s=random(145 - user_on->throwing_ability);
  1612.        user_on->rocks--;
  1613.        if(hit_s<35) {
  1614.      hit_s = (long)user_on->strength * (pow((user_on->level/2)+2,1.2)*6.0*(user_on->throwing_ability/110.0)) * (double)((random(80)+90)/100.0);
  1615.      ny_line(443,2,0);
  1616.        } else {
  1617.      hit_s=0;
  1618.      ny_line(444,2,0);
  1619.        }
  1620.      }
  1621.  
  1622.   /*  if (key == 'T') {  // Take drugs
  1623.       take_drug();
  1624.       no_rip_m=0;
  1625.       key='A';
  1626.     }
  1627.     if (key=='A') {-/
  1628.       // when atacking
  1629. //      randomize();
  1630.       if(key=='A')
  1631.     hit_s = user_on->strength * (what_arm_force(user_on->arm)) * (double)((random(80)+80)/100.0);
  1632.     // If he is on drugs
  1633.       if(user_on->drug_high > 0)
  1634.     hit_s = (hit_s * what_drug_force_a(user_on->drug,user_on->drug_high));
  1635.  
  1636. //      hit_s*=pow(1.1,user_on->level);
  1637.  
  1638.       hit_s*=(100.0-(user_on->since_got_laid*2))/100.0;
  1639.       if (user_on->drug>=COKE) hit_s-=random(user_on->drug_days_since * pow((double)user_on->drug_addiction,1.2))/60;
  1640.       if (hit_s<0) hit_s=0;
  1641.  
  1642.       def_s = user_on->defense * what_drug_force_d(user_on->drug,user_on->drug_high) * (double)((random(80)+140)/100.0);
  1643.       def_s*=pow(1.2,user_on->level);
  1644.       def_s*=(100.0-(user_on->since_got_laid*2))/100.0;
  1645.       if (user_on->drug>=COKE) def_s-=random(user_on->drug_days_since * pow(user_on->drug_addiction,1.2))/60;
  1646.       if (def_s<0) def_s=0;
  1647.  
  1648.       def_s/=2;
  1649.  
  1650.       sprintf(numstr,"u%07d.atk",enm_num);
  1651.       justfile = ShareFileOpen(numstr, "wb");
  1652.       ny_fwrite(&hit_s,4,1,justfile);
  1653.       fclose(justfile);
  1654.       sprintf(numstr,"u%07d.atk",enm_num);
  1655.       sprintf(numstr2,"u%07d.on",enm_num);
  1656.       ny_line(222,2,1);
  1657. //      od_printf("\n\r\n`bright red`W`red`aiting....\n\r");
  1658.       t=time(NULL);
  1659.       t2=t;
  1660.  
  1661.       while ((findfirst(numstr,&fff,0)==0) && (findfirst(numstr2,&fff,0)==0)){
  1662.     fgc(&enm_num,user_num);
  1663.     sprintf(numstr,"u%07d.atk",enm_num);
  1664.     sprintf(numstr2,"u%07d.on",enm_num);
  1665.     while(t==t2) {
  1666.       t=time(NULL);
  1667.       od_kernal();
  1668.     }
  1669.     t2=t;
  1670.     od_kernal();
  1671.       }
  1672.  
  1673.       if (findfirst(numstr2,&fff,0)!=0) {
  1674.  
  1675.     ny_line(223,2,1);
  1676.     if(rip) od_get_answer("\n\r");
  1677.     ny_line(224,0,1);
  1678. //    od_printf("\n\r\n`bright red`Y`red`er enemy droped carrier on ya!\n\r`bright red`G`red`o and kill him offline\n\r");
  1679.  
  1680.     //sprintf(numstr,"del u%07d.atk",enm_num);
  1681.     //system(numstr);
  1682.     ny_remove(numstr);
  1683.     sprintf(numstr,"u%07d.fgg",*user_num);
  1684.     ny_remove(numstr);
  1685.     if(!rip) ny_line(1,1,0);
  1686.     od_get_answer("\n\r");
  1687.     return;
  1688.       }
  1689.  
  1690.       intval=erec.hitpoints;
  1691.  
  1692.       sprintf(numstr,"u%07d.sts",enm_num);
  1693.       justfile=ShareFileOpen(numstr,"rb");
  1694.       ny_fread(&erec,sizeof(user_rec),1,justfile);
  1695.       fclose(justfile);
  1696.  
  1697.       intval -= erec.hitpoints;
  1698.  
  1699.       fgc(&enm_num,user_num);
  1700.  
  1701.  
  1702.       ny_line(208,2,0);
  1703. //      od_printf("\n\r\n`bright red`Y`red`a kick `bright green`");
  1704.       ny_disp_emu(erec.name);
  1705.       ny_line(209,0,0);
  1706.       //od_printf("'s `red`ass fer `bright green`%d `red`damage",
  1707.       od_printf(D_Num(intval));
  1708.       ny_line(210,0,0);
  1709.  
  1710.  
  1711.      } else if (key=='G') {
  1712.        intval=random(2);
  1713.        if (intval==0) {
  1714.  
  1715.      ny_line(212,2,1);
  1716.      //od_printf("\n\r\n`bright red`Y`red`a got away ...\n\r");
  1717.  
  1718.      sprintf(numstr,"u%07d.atk",enm_num);
  1719.      justfile = ShareFileOpen(numstr, "wb");
  1720.      intval=-1; //user got away
  1721.      ny_fwrite(&intval,4,1,justfile);
  1722.      fclose(justfile);
  1723.      sprintf(numstr,"u%07d.fgg",*user_num);
  1724.      ny_remove(numstr);
  1725.      if(!rip)
  1726.        WaitForEnter();
  1727.      else
  1728.        od_get_answer("\n\r");
  1729.      return;
  1730.        } else {
  1731.  
  1732.      ny_line(213,2,1);
  1733. //     od_printf("\n\r\n`bright red`Y`red`e couldn't find a way outta this ...\n\r");
  1734.  
  1735.      sprintf(numstr,"u%07d.atk",enm_num);
  1736.      justfile = ShareFileOpen(numstr, "wb");
  1737.      intval=-2; ///user couldn't get away
  1738.      ny_fwrite(&intval,4,1,justfile);
  1739.      fclose(justfile);
  1740.      sprintf(numstr,"u%07d.atk",enm_num);
  1741.      sprintf(numstr2,"u%07d.on",enm_num);
  1742.      ny_line(222,2,1);
  1743.  
  1744.      t=time(NULL);
  1745.      t2=t;
  1746.  
  1747.      //od_printf("\n\r\n`bright red`W`red`aiting....\n\r");
  1748.      while ((findfirst(numstr,&fff,0)==0) && (findfirst(numstr2,&fff,0)==0)){
  1749.        fgc(&enm_num,user_num);
  1750.        sprintf(numstr,"u%07d.atk",enm_num);
  1751.        sprintf(numstr2,"u%07d.on",enm_num);
  1752.        while(t==t2) {
  1753.          t=time(NULL);
  1754.          od_kernal();
  1755.        }
  1756.        t2=t;
  1757.  
  1758.        od_kernal();
  1759.      }
  1760.  
  1761.      if (findfirst(numstr2,&fff,0)!=0) {
  1762.  
  1763.        ny_line(223,2,1);
  1764.        if(rip) od_get_answer("\n\r");
  1765.        ny_line(224,0,1);
  1766.        //od_printf("\n\r\n`bright red`Y`red`er enemy droped carrier on ya!\n\r`bright red`G`red`o and kill him offline\n\r");
  1767.  
  1768. //       sprintf(numstr,"del u%07d.atk",enm_num);
  1769. //       system(numstr);
  1770.        ny_remove(numstr);
  1771.        sprintf(numstr,"u%07d.fgg",*user_num);
  1772.        ny_remove(numstr);
  1773.        if(!rip)
  1774.          WaitForEnter();
  1775.        else
  1776.          od_get_answer("\n\r");
  1777.        return;
  1778.      }
  1779.        }
  1780.      }*/// else {
  1781.       // DisplayStats();
  1782.      //}
  1783.  
  1784. /*      sprintf(numstr,"u%07d.atk",*user_num);
  1785.  
  1786.       ny_line(225,2,1);
  1787. //      od_printf("\n\r\n`bright red`W`red`aiting fer enemy response....\n\r");
  1788.  
  1789.  
  1790.       t=time(NULL);
  1791.       t2=t;
  1792.       while (findfirst(numstr,&fff,0)!=0 && findfirst(numstr2,&fff,0)==0) {
  1793.     fgc(&enm_num,user_num);
  1794.     sprintf(numstr2,"u%07d.on",enm_num);
  1795.     sprintf(numstr,"u%07d.atk",*user_num);
  1796.     while(t==t2) {
  1797.       t=time(NULL);
  1798.       od_kernal();
  1799.     }
  1800.     t2=t;
  1801.     od_kernal();
  1802.       }
  1803.       fgc(&enm_num,user_num);
  1804.       if (findfirst(numstr2,&fff,0)!=0) {
  1805.  
  1806.     ny_line(223,2,1);
  1807.     if(rip) od_get_answer("\n\r");
  1808.     ny_line(224,0,1);
  1809. //    od_printf("\n\r\n`bright red`Y`red`er enemy droped carrier on ya!\n\r`bright red`G`red`o and kill him offline\n\r");
  1810.  
  1811.     sprintf(numstr,"u%07d.fgg",*user_num);
  1812.     ny_remove(numstr);
  1813.     if(!rip)
  1814.       WaitForEnter();
  1815.     else
  1816.       od_get_answer("\n\r");
  1817.     return;
  1818.       }
  1819.  
  1820.       //read atack file
  1821.       sprintf(numstr,"u%07d.atk",*user_num);
  1822.       justfile = ShareFileOpen(numstr, "rb");
  1823.       ny_fread(&en_hit_s,4,1,justfile);
  1824.       fclose(justfile);
  1825.  
  1826.       if (en_hit_s==-1) {
  1827.  
  1828.     ny_line(226,2,1);
  1829. //    od_printf("\n\r\n`bright red`Y`red`er enemy ran away in fear...\n\r");
  1830.  
  1831.     ny_remove(numstr);
  1832.     sprintf(numstr,"u%07d.fgg",*user_num);
  1833.     ny_remove(numstr);
  1834.     //sprintf(numstr,"del u%07d.atk",*user_num);
  1835.     //system(numstr); //see above!
  1836.     if(!rip)
  1837.       WaitForEnter();
  1838.     else
  1839.       od_get_answer("\n\r");
  1840.     return;
  1841.       }
  1842.       if (en_hit_s==-9) {
  1843.  
  1844.     ny_line(227,2,2);
  1845. //    od_printf("\n\r\n`bright red`Y`red`a `bright white`WON`red`!\n\r\n");
  1846.     sprintf(numstr,"u%07d.atk",*user_num);
  1847.     justfile = ShareFileOpen(numstr, "rb");
  1848.  
  1849.     ny_fread(&en_hit_s,4,1,justfile);
  1850.     ny_fread(&intval,4,1,justfile);
  1851.  
  1852.     fclose(justfile);
  1853.  
  1854.     money_plus(intval);
  1855.  
  1856.     ny_line(216,0,0);
  1857. //    od_printf("`bright red`Y`red`a find `bright red`
  1858.     od_printf(D_Num(intval));
  1859.     ny_line(217,0,0);
  1860.     intval=.08*erec.points;
  1861.     od_printf(D_Num((unsigned long)intval * (unsigned long)DrgPtsCoef()));
  1862.     ny_line(218,0,1);
  1863.     points_raise(intval);
  1864.  
  1865.     ny_kernel();
  1866.  
  1867.  
  1868.     //no_kernel=TRUE;
  1869.     wrt_sts();
  1870.     //no_kernel=FALSE;
  1871.  
  1872.     if (erec.arm>user_on->arm) {
  1873.  
  1874.       ny_line(228,2,0);
  1875. //      od_printf("\n\r\n`bright red`D`red`o ya wanna swap weapons with`bright green` ");
  1876.       if(!rip)
  1877.         ny_disp_emu(erec.name);
  1878.       else
  1879.         od_disp_str(ny_un_emu(erec.name,numstr));
  1880.       ny_line(79,0,0);
  1881.       //ny_disp_emu("`4? (`@Y`4/`@N`4)");
  1882.  
  1883.       key=od_get_answer("YN");
  1884.       if(!rip)
  1885.         od_printf("%c\n\r",key);
  1886.       else
  1887.         od_disp_str("\n\r");
  1888.  
  1889.       if (key=='Y') {
  1890.  
  1891.         weapon tarm;
  1892.  
  1893.         tarm=erec.arm;
  1894.         erec.arm=user_on->arm;
  1895.         user_on->arm=tarm;
  1896.         sprintf(numstr,"u%07d.on",enm_num);
  1897.         if (findfirst(numstr,&fff,0)==0) {
  1898.           sprintf(numstr,"u%07d.swp",enm_num);
  1899.           justfile=ShareFileOpen(numstr,"wb");
  1900.           ny_fwrite(&erec.arm,2,1,justfile);
  1901.           fclose(justfile);
  1902.         } else {
  1903.           tarm=erec.arm;
  1904.           ch_game_d();
  1905.           justfile=ShareFileOpen(USER_FILENAME,"r+b");
  1906.           fseek(justfile,enm_num*sizeof(user_rec),SEEK_SET);
  1907.           ny_fread(&erec,sizeof(user_rec),1,justfile);
  1908.           erec.arm=tarm;
  1909.           fseek(justfile,enm_num*sizeof(user_rec),SEEK_SET);
  1910.           ny_fwrite(&erec,sizeof(user_rec),1,justfile);
  1911.           fclose(justfile);
  1912.           ch_flag_d();
  1913.         }
  1914.  
  1915.         ny_line(229,2,0);
  1916. //        od_printf("\n\r`bright red`D`red`one! `bright red`Y`red`ou now got the `bright green`");
  1917.  
  1918.         print_arm(user_on->arm);
  1919.         if(rip) {
  1920.           od_disp_str("::^M@OK))|#|#|#\n\r\n");
  1921.           od_get_answer("\n\r");
  1922.         }
  1923.         od_printf("\n\r\n");
  1924.  
  1925.       }
  1926.     }
  1927.  
  1928.     if (erec.sex!=user_on->sex && clean_mode==FALSE && user_on->sex_today>0) {
  1929.  
  1930.       ny_line(230,2,0);
  1931. //      od_printf("\n\r\n`bright red`D`red`o ya wanna rape `bright green`");
  1932.       if(!rip)
  1933.         ny_disp_emu(erec.name);
  1934.       else
  1935.         od_disp_str(ny_un_emu(erec.name,numstr));
  1936.       ny_line(79,0,0);
  1937. //      ny_disp_emu("`4? (`@Y`4/`@N`4)");
  1938.  
  1939.       key=od_get_answer("YN");
  1940.       if(!rip)
  1941.         od_printf("%c\n\r",key);
  1942.       else
  1943.         od_disp_str("\n\r");
  1944.       if (key=='Y') {
  1945.         if (user_on->sex_today<=0) {
  1946.  
  1947.           ny_line(118,2,1);
  1948.           //od_printf("\n\r\n`bright white`You already used up all your sex turns today ...\n\r");
  1949.  
  1950.           if(rip)
  1951.         od_get_answer("\n\r");
  1952.           sprintf(numstr,"u%07d.on",enm_num);
  1953.           if (findfirst(numstr,&fff,0)==0) {
  1954.         sprintf(numstr,"u%07d.kik",enm_num);
  1955.         justfile=ShareFileOpen(numstr,"wb");
  1956.         rape=-1;
  1957.         ny_fwrite(&rape,2,2,justfile);
  1958.         fclose(justfile);
  1959.           }
  1960. //          WaitForEnter();
  1961.         } else {
  1962.           sprintf(numstr,"u%07d.on",enm_num);
  1963.           if (findfirst(numstr,&fff,0)==0) {
  1964.         sprintf(numstr,"u%07d.kik",enm_num);
  1965.         justfile=ShareFileOpen(numstr,"wb");
  1966.         ny_fwrite(&user_on->std,2,1,justfile);
  1967.         ny_fwrite(&user_on->std_percent,2,1,justfile);
  1968.         fclose(justfile);
  1969.           } else {
  1970.         strcpy(mail_idx.recver,erec.name);
  1971.         strcpy(mail_idx.sender,user_on->name);
  1972.         strcpy(mail_idx.recverI,erec.bbsname);
  1973.         strcpy(mail_idx.senderI,user_on->bbsname);
  1974.         mail_idx.flirt=1000;
  1975.         mail_idx.deleted=FALSE;
  1976.         mail_idx.location=0;
  1977.         mail_idx.length=0;
  1978.         mail_idx.afterquote=0;
  1979.         mail_idx.ill=user_on->std;
  1980.         mail_idx.inf=user_on->std_percent;
  1981.         mail_idx.sender_sex=user_on->sex;
  1982.         ch_game_d();
  1983.         justfile=ShareFileOpen(MAIL_INDEX,"a+b");
  1984.         ny_fwrite(&mail_idx,sizeof(mail_idx_type),1,justfile);
  1985.         fclose(justfile);
  1986.         ch_flag_d();
  1987.           }
  1988.           user_on->since_got_laid=0;
  1989.           user_on->sex_today--;
  1990.           ny_line(339,1,0);
  1991.           if(rip)
  1992.         ny_disp_emu(erec.name);
  1993.           else
  1994.         od_disp_str(ny_un_emu(erec.name,numstr));
  1995.           ny_line(340,0,1);
  1996.           if(rip)
  1997.         od_get_answer("\n\r");
  1998.           illness(erec.std,erec.std_percent);
  1999.           points_raise((long)35*(user_on->level+1));
  2000.  
  2001. //          char omg[51];
  2002.  
  2003.          // sprintf(omg,"%s raped you after beating you ...",user_on->name);
  2004.         }
  2005.       } else {
  2006.         sprintf(numstr,"u%07d.on",enm_num);
  2007.         if (findfirst(numstr,&fff,0)==0) {
  2008.           sprintf(numstr,"u%07d.kik",enm_num);
  2009.           justfile=ShareFileOpen(numstr,"wb");
  2010.           rape=-1;
  2011.           ny_fwrite(&rape,2,2,justfile);
  2012.           fclose(justfile);
  2013.         }
  2014.       }
  2015.     }
  2016.  
  2017.     sprintf(numstr,"u%07d.fgg",*user_num);
  2018.     ny_remove(numstr);
  2019.  
  2020.     sprintf(numstr,"u%07d.atk",*user_num);
  2021.     ny_remove(numstr);
  2022.  
  2023.     wrt_sts();
  2024.  
  2025.     if(!rip) WaitForEnter();
  2026.     return;
  2027.       }
  2028.       if (en_hit_s!=-2) {
  2029.     en_hit_s-=def_s;
  2030.     if (en_hit_s<0) en_hit_s=0;
  2031.  
  2032.     user_on->hitpoints-=en_hit_s;
  2033.     wrt_sts();
  2034.  
  2035.  
  2036.     ny_disp_emu("\n\r\n`0");
  2037.     ny_disp_emu(erec.name);
  2038.     ny_line(211,0,0);
  2039. //    od_printf(" `red`kicks yer ass fer `bright green`
  2040.     od_printf(D_Num(en_hit_s));
  2041.     ny_line(210,0,0);
  2042.  
  2043.  
  2044.     if (user_on->hitpoints <= 0) {
  2045.       sprintf(numstr,"u%07d.atk",*user_num);
  2046.       ny_remove(numstr);
  2047.       sprintf(numstr,"u%07d.atk",enm_num);
  2048.       justfile = ShareFileOpen(numstr, "wb");
  2049.       intval=-9; //user lost
  2050.       ny_fwrite(&intval,4,1,justfile);
  2051.       intval=user_on->money; //users money
  2052.       ny_fwrite(&intval,4,1,justfile);
  2053.       fclose(justfile);
  2054.  
  2055.       od_printf("\n\r\n");
  2056.       ny_send_menu(ASS_KICKED_O,"");
  2057. /*      od_printf("\n\r\n`bright red`Y`red`a `bright white`LOST`red`!!!!\n\r");
  2058.       od_printf("`bright red`C`red`ome back tomorrow to get revenge\n\r");
  2059.       od_printf("`bright red`8%c`red` of yer points lost\n\r",37);-/
  2060.  
  2061.       user_on->alive=UNCONCIOUS;
  2062.       user_on->money=0;
  2063.       points_loose(user_on->points*.08);
  2064.       //wrt_sts();
  2065.  
  2066.       if (erec.sex!=user_on->sex) {
  2067.         sprintf(numstr,"u%07d.kik",*user_num);
  2068.         sprintf(numstr2,"u%07d.on",enm_num);
  2069.  
  2070.         ny_line(225,2,1);
  2071. //        od_printf("\n\r\n`bright red`W`red`aiting fer enemy response....\n\r");
  2072.  
  2073.         t=time(NULL);
  2074.         t2=t;
  2075.         while (findfirst(numstr,&fff,0)!=0 && findfirst(numstr2,&fff,0)==0) {
  2076.           fgc(&enm_num,user_num);
  2077.           sprintf(numstr2,"u%07d.on",enm_num);
  2078.           sprintf(numstr,"u%07d.kik",*user_num);
  2079.           while(t==t2) {
  2080.         t=time(NULL);
  2081.         od_kernal();
  2082.           }
  2083.           t2=t;
  2084.           od_kernal();
  2085.         }
  2086.         if (findfirst(numstr,&fff,0)==0) {
  2087.           int ill;
  2088.           int inf;
  2089.  
  2090.           justfile=ShareFileOpen(numstr,"rb");
  2091.           ny_fread(&ill,2,1,justfile);
  2092.           ny_fread(&inf,2,1,justfile);
  2093.           fclose(justfile);
  2094.  
  2095.           ny_remove(numstr);
  2096.           //sprintf(numstr,"del u%07d.kik",*user_num);
  2097.           //system(numstr);
  2098.  
  2099.           if (ill!=1) {
  2100.         illness((desease)ill,inf);
  2101.  
  2102.  
  2103.         ny_disp_emu("\n\r`0");
  2104.         ny_disp_emu(erec.name);
  2105.         ny_line(232,0,1);
  2106. //        od_printf(" `red`raped ya!\n\r");
  2107.  
  2108.           }
  2109.         }
  2110.       }
  2111.  
  2112.  
  2113.       fig_ker();
  2114.       WaitForEnter();
  2115.       od_exit(10,FALSE);
  2116.     }
  2117.  
  2118.     sprintf(numstr,"u%07d.atk",*user_num);
  2119.     ny_remove(numstr);
  2120.       } else {
  2121.  
  2122.     od_printf("\n\r\n`0");
  2123.     ny_disp_emu(erec.name);
  2124.     ny_line(231,2,0);
  2125. //    od_printf("\n\r\n`bright green`%s`red` tried to get away but could not ...");
  2126.  
  2127.       }*/
  2128.  
  2129.   } while (1);
  2130. }
  2131.  
  2132.  
  2133.  
  2134.  
  2135. void
  2136. online_fight(int *user_num, user_rec *user_on, int enm_num)
  2137. {
  2138. //  mail_idx_type mail_idx;
  2139. //  int rape;
  2140.   char numstr[25];
  2141. //  char numstr2[25];
  2142. //  unsigned long intval;
  2143.   user_rec erec;
  2144. //  ffblk ffblk;
  2145. //  FILE *justfile;
  2146. //  char key;
  2147. //  long hit_s,def_s,en_hit_s;
  2148. //  time_t t,t2;
  2149.  
  2150.   sfflg(*user_num,numstr,enm_num,&erec);
  2151.  
  2152.   ny_disp_emu("\n\r\n`@");
  2153.   ny_disp_emu(erec.name);
  2154.   ny_line(294,0,1);
  2155.  
  2156.   sprintf(numstr,"u%07d.chl",*user_num);
  2157.   ny_remove(numstr);
  2158.   do {
  2159.     if(o_checks(&enm_num,user_num,user_on,&erec)) return;
  2160.     if(fig_m(&erec,user_on,&enm_num,user_num)) return;
  2161.  
  2162.  
  2163.   /*    sprintf(numstr,"u%07d.atk",*user_num);
  2164.       sprintf(numstr2,"u%07d.on",enm_num);
  2165.  
  2166.       ny_line(225,2,1);
  2167. //      od_printf("\n\r\n`bright red`W`red`aiting fer enemy response....\n\r");
  2168.  
  2169.       t=time(NULL);
  2170.       t2=t;
  2171.       while (findfirst(numstr,&fff,0)!=0 && findfirst(numstr2,&fff,0)==0) {
  2172.     fgc(&enm_num,user_num);
  2173.     sprintf(numstr2,"u%07d.on",enm_num);
  2174.     sprintf(numstr,"u%07d.atk",*user_num);
  2175.     while(t==t2) {
  2176.       t=time(NULL);
  2177.       od_kernal();
  2178.     }
  2179.     t2=t;
  2180.     od_kernal();
  2181.       }
  2182.  
  2183. //      fgc(&enm_num,user_num);
  2184.       if (findfirst(numstr2,&fff,0)!=0) {
  2185.  
  2186.     ny_line(223,2,1);
  2187.     if(rip) od_get_answer("\n\r");
  2188.     ny_line(224,0,1);
  2189.   //    od_printf("\n\r\n`bright red`Y`red`er enemy droped carrier on ya!\n\r`bright red`G`red`o and kill him offline\n\r");
  2190.  
  2191.     sprintf(numstr,"u%07d.fgg",*user_num);
  2192.     ny_remove(numstr);
  2193.     if(!rip) ny_line(1,1,0);
  2194.     od_get_answer("\n\r");
  2195.     return;
  2196.       }
  2197.  
  2198.       //read atack file
  2199.       sprintf(numstr,"u%07d.atk",*user_num);
  2200.       justfile = ShareFileOpen(numstr, "rb");
  2201.       ny_fread(&en_hit_s,4,1,justfile);
  2202.       fclose(justfile);
  2203.  
  2204.       if (en_hit_s==-1) {
  2205.  
  2206.     ny_line(226,2,1);
  2207. //    od_printf("\n\r\n`bright red`Y`red`er enemy ran away in fear...\n\r");
  2208.  
  2209.     sprintf(numstr,"u%07d.fgg",*user_num);
  2210.     ny_remove(numstr);
  2211.     sprintf(numstr,"u%07d.atk",*user_num);
  2212.     ny_remove(numstr);
  2213.     if(!rip) ny_line(1,1,0);
  2214.     od_get_answer("\n\r");
  2215.     return;
  2216.       }
  2217.       if (en_hit_s==-9) {
  2218.  
  2219.     ny_line(227,2,2);
  2220. //    od_printf("\n\r\n`bright red`Y`red`a `bright white`WON`red`!\n\r\n");
  2221.     sprintf(numstr,"u%07d.atk",*user_num);
  2222.     justfile = ShareFileOpen(numstr, "rb");
  2223.     ny_fread(&en_hit_s,4,1,justfile);
  2224.     ny_fread(&intval,4,1,justfile);
  2225.     fclose(justfile);
  2226.     money_plus(intval);
  2227.     ny_line(216,0,0);
  2228.     od_printf(D_Num(intval));
  2229.     intval=.08*erec.points;
  2230.     ny_line(217,0,0);
  2231.     od_printf(D_Num((unsigned long)intval * (unsigned long)DrgPtsCoef()));
  2232.     ny_line(218,0,1);
  2233.     points_raise(intval);
  2234.  
  2235.     wrt_sts();
  2236.     if (erec.arm>user_on->arm) {
  2237.  
  2238.       ny_line(228,2,0);
  2239. //      od_printf("\n\r\n`bright red`D`red`o ya wanna swap weapons with`bright green` ");
  2240.       ny_disp_emu(erec.name);
  2241.       ny_line(79,0,0);
  2242.       //ny_disp_emu("`4? (`@Y`4/`@N`4)");
  2243.  
  2244.       key=od_get_answer("YN");
  2245.       if(!rip)
  2246.         od_printf("%c\n\r",key);
  2247.       else
  2248.         od_disp_str("\n\r");
  2249.       if (key=='Y') {
  2250.  
  2251.         weapon tarm;
  2252.  
  2253.         tarm=erec.arm;
  2254.         erec.arm=user_on->arm;
  2255.         user_on->arm=tarm;
  2256.         sprintf(numstr,"u%07d.on",enm_num);
  2257.         if (findfirst(numstr,&fff,0)==0) {
  2258.           sprintf(numstr,"u%07d.swp",enm_num);
  2259.           justfile=ShareFileOpen(numstr,"wb");
  2260.           ny_fwrite(&erec.arm,2,1,justfile);
  2261.           fclose(justfile);
  2262.         } else {
  2263.           tarm=erec.arm;
  2264.           ch_game_d();
  2265.           justfile=ShareFileOpen(USER_FILENAME,"r+b");
  2266.           fseek(justfile,enm_num*sizeof(user_rec),SEEK_SET);
  2267.           ny_fread(&erec,sizeof(user_rec),1,justfile);
  2268.           erec.arm=tarm;
  2269.           fseek(justfile,enm_num*sizeof(user_rec),SEEK_SET);
  2270.           ny_fwrite(&erec,sizeof(user_rec),1,justfile);
  2271.           fclose(justfile);
  2272.           ch_flag_d();
  2273.         }
  2274.  
  2275.         ny_line(229,2,0);
  2276. //        od_printf("\n\r`bright red`D`red`one! `bright red`Y`red`ou now got the `bright green`");
  2277.  
  2278.         print_arm(user_on->arm);
  2279.         if(rip) {
  2280.           od_disp_str("::^M@OK))|#|#|#\n\r\n");
  2281.           od_get_answer("\n\r");
  2282.         }
  2283.         od_printf("\n\r\n");
  2284.  
  2285.       }
  2286.     }
  2287.  
  2288.     if (erec.sex!=user_on->sex && clean_mode==FALSE && user_on->sex_today>0) {
  2289.  
  2290.       ny_line(230,2,0);
  2291. //      od_printf("\n\r\n`bright red`D`red`o ya wanna rape `bright green`");
  2292.       ny_disp_emu(erec.name);
  2293.       ny_line(79,0,0);
  2294. //      ny_disp_emu("`4? (`@Y`4/`@N`4)");
  2295.  
  2296.       key=od_get_answer("YN");
  2297.       if(!rip)
  2298.         od_printf("%c\n\r",key);
  2299.       else
  2300.         od_disp_str("\n\r");
  2301.       if (key=='Y') {
  2302.         if (user_on->sex_today<=0) {
  2303.  
  2304.           ny_line(118,2,1);
  2305. //          od_printf("\n\r\n`bright white`You already used up all your sex turns today ...\n\r");
  2306.  
  2307.           if(rip)
  2308.         od_get_answer("\n\r");
  2309.           sprintf(numstr,"u%07d.on",enm_num);
  2310.           if (findfirst(numstr,&fff,0)==0) {
  2311.         sprintf(numstr,"u%07d.kik",enm_num);
  2312.         justfile=ShareFileOpen(numstr,"wb");
  2313.         rape=-1;
  2314.         ny_fwrite(&rape,2,2,justfile);
  2315.         fclose(justfile);
  2316.           }
  2317. //          WaitForEnter();
  2318.         } else {
  2319.           sprintf(numstr,"u%07d.on",enm_num);
  2320.           if (findfirst(numstr,&fff,0)==0) {
  2321.         sprintf(numstr,"u%07d.kik",enm_num);
  2322.         justfile=ShareFileOpen(numstr,"wb");
  2323.         ny_fwrite(&user_on->std,2,1,justfile);
  2324.         ny_fwrite(&user_on->std_percent,2,1,justfile);
  2325.         fclose(justfile);
  2326.           } else {
  2327.         strcpy(mail_idx.recver,erec.name);
  2328.         strcpy(mail_idx.sender,user_on->name);
  2329.         strcpy(mail_idx.recverI,erec.bbsname);
  2330.         strcpy(mail_idx.senderI,user_on->bbsname);
  2331.         mail_idx.flirt=1000;
  2332.         mail_idx.deleted=FALSE;
  2333.         mail_idx.location=0;
  2334.         mail_idx.length=0;
  2335.         mail_idx.afterquote=0;
  2336.         mail_idx.ill=user_on->std;
  2337.         mail_idx.inf=user_on->std_percent;
  2338.         mail_idx.sender_sex=user_on->sex;
  2339.         ch_game_d();
  2340.         justfile=ShareFileOpen(MAIL_INDEX,"a+b");
  2341.         ny_fwrite(&mail_idx,sizeof(mail_idx_type),1,justfile);
  2342.         fclose(justfile);
  2343.         ch_flag_d();
  2344.           }
  2345.  
  2346.           user_on->since_got_laid=0;
  2347.           user_on->sex_today--;
  2348.           ny_line(339,1,0);
  2349.           if(!rip)
  2350.         ny_disp_emu(erec.name);
  2351.           else
  2352.         od_disp_str(ny_un_emu(erec.name,numstr));
  2353.           ny_line(340,0,1);
  2354.           if(rip)
  2355.         od_get_answer("\n\r");
  2356.  
  2357.           illness(erec.std,erec.std_percent);
  2358.           points_raise((long)35*(user_on->level+1));
  2359.         }
  2360.       } else {
  2361.         sprintf(numstr,"u%07d.on",enm_num);
  2362.         if (findfirst(numstr,&fff,0)==0) {
  2363.           sprintf(numstr,"u%07d.kik",enm_num);
  2364.           justfile=ShareFileOpen(numstr,"wb");
  2365.           rape=-1;
  2366.           ny_fwrite(&rape,2,2,justfile);
  2367.           fclose(justfile);
  2368.         }
  2369.       }
  2370.     }
  2371.     sprintf(numstr,"u%07d.fgg",*user_num);
  2372.     ny_remove(numstr);
  2373.     sprintf(numstr,"u%07d.atk",*user_num);
  2374.     ny_remove(numstr);
  2375.     if(!rip) {
  2376.       ny_line(1,1,0);
  2377.       od_get_answer("\n\r");
  2378.     }
  2379.     return;
  2380.       }
  2381.       if (en_hit_s!=-2) {
  2382.     en_hit_s-=def_s;
  2383.     if (en_hit_s<0) en_hit_s=0;
  2384.  
  2385.     user_on->hitpoints-=en_hit_s;
  2386.     wrt_sts();
  2387.  
  2388.  
  2389.     ny_disp_emu("\n\r\n`0");
  2390.     ny_disp_emu(erec.name);
  2391.     ny_line(211,0,0);
  2392.     od_printf(D_Num(en_hit_s));
  2393.     ny_line(210,0,0);
  2394.  
  2395.  
  2396.     if (user_on->hitpoints <= 0) {
  2397.       sprintf(numstr,"u%07d.atk",*user_num);
  2398.       ny_remove(numstr);
  2399.       sprintf(numstr,"u%07d.atk",enm_num);
  2400.       justfile = ShareFileOpen(numstr, "wb");
  2401.       intval=-9; //user lost
  2402.       ny_fwrite(&intval,4,1,justfile);
  2403.       intval=user_on->money; //users money
  2404.       ny_fwrite(&intval,4,1,justfile);
  2405.       fclose(justfile);
  2406.  
  2407.       od_printf("\n\r\n");
  2408.       ny_send_menu(ASS_KICKED_O,"");
  2409.       /*`bright red`Y`red`a `bright white`LOST`red`!!!!\n\r");
  2410.       od_printf("`bright red`C`red`ome back tomorrow to get revenge\n\r");
  2411.       od_printf("`bright red`8%c`red` of yer points lost\n\r",37);-/
  2412.  
  2413.       user_on->alive=UNCONCIOUS;
  2414.       user_on->money=0;
  2415.       points_loose(user_on->points*.08);
  2416.       //wrt_sts();
  2417.  
  2418.  
  2419.  
  2420.       if (erec.sex!=user_on->sex) {
  2421.         sprintf(numstr,"u%07d.kik",*user_num);
  2422.         sprintf(numstr2,"u%07d.on",enm_num);
  2423.  
  2424.         ny_line(225,2,1);
  2425. //        od_printf("\n\r\n`bright red`W`red`aiting fer enemy response....\n\r");
  2426.  
  2427.         t=time(NULL);
  2428.         t2=t;
  2429.         while (findfirst(numstr,&fff,0)!=0 && findfirst(numstr2,&fff,0)==0) {
  2430.           fgc(&enm_num,user_num);
  2431.           sprintf(numstr2,"u%07d.on",enm_num);
  2432.           sprintf(numstr,"u%07d.kik",*user_num);
  2433.           while(t==t2) {
  2434.         t=time(NULL);
  2435.         od_kernal();
  2436.           }
  2437.           t2=t;
  2438.           od_kernal();
  2439.         }
  2440.         if (findfirst(numstr,&fff,0)==0) {
  2441.           int ill;
  2442.           int inf;
  2443.  
  2444.           justfile=ShareFileOpen(numstr,"rb");
  2445.           ny_fread(&ill,2,1,justfile);
  2446.           ny_fread(&inf,2,1,justfile);
  2447.           fclose(justfile);
  2448.  
  2449.           sprintf(numstr,"u%07d.kik",*user_num);
  2450.           ny_remove(numstr);
  2451.  
  2452.           if (ill!=-1) {
  2453.         illness((desease)ill,inf);
  2454.  
  2455.         ny_disp_emu("\n\r`0");
  2456.         ny_disp_emu(erec.name);
  2457.         ny_line(232,0,1);
  2458. //        od_printf(" `red`raped ya!\n\r");
  2459.  
  2460.           }
  2461.         }
  2462.       }
  2463.       ny_line(1,1,0);
  2464.       od_get_answer("\n\r");
  2465.       od_exit(10,FALSE);
  2466.     }
  2467.  
  2468.     sprintf(numstr,"u%07d.atk",*user_num);
  2469.     ny_remove(numstr);
  2470.       } else {
  2471.  
  2472.     od_printf("\n\r\n`0");
  2473.     ny_disp_emu(erec.name);
  2474.     ny_line(231,0,0);
  2475. //    od_printf("\n\r\n`bright green`%s`red` tried to get away but could not ...");
  2476.  
  2477.       }*/
  2478.  
  2479.  
  2480.     /*do {
  2481.  
  2482.       bam_of2:
  2483.       ny_line(221,3,0);
  2484. //      od_printf("\n\r\n\n\r`bright red`O`red`nline `bright red`P`red`layer `bright red`F`red`ight");
  2485.       ny_disp_emu("\n\r\n`0");
  2486.       ny_disp_emu(erec.name);
  2487.       ny_line(205,0,0);
  2488. //      od_printf("'s `bright red`H`red`itpoints: %s",
  2489.       od_printf(D_Num(erec.hitpoints));
  2490.       ny_line(206,1,0);
  2491. //      od_printf("\n\r`bright red`Y`red`er `bright red`H`red`itpoints: %s",
  2492.     od_printf(D_Num(user_on->hitpoints));
  2493.       od_printf("\n\r\n");
  2494. /*      od_printf("\n\r\n`bright red`[A] `red`- `bright red`A`red`ttack\n\r");
  2495.       od_printf("`bright red`[T] `red`- `bright red`T`red`ake `bright red`D`red`rug `bright red`A`red`nd `bright red`A`red`ttack\n\r");
  2496.       od_printf("`bright red`[G] `red`- `bright red`G`red`et `bright red`O`red`utta `bright red`H`red`ere\n\r");
  2497.       od_printf("`bright red`[Y] `red`- `bright red`Y`red`er `bright red`S`red`tats\n\r");
  2498.       od_printf("\n\r`bright red`W`red`hat ya gonna do? (`bright red`[A] G Y`red`)");-/
  2499.       ny_send_menu(ATTACK,"");
  2500.       ny_line(207,1,0);
  2501. //      ny_disp_emu("\n\r`@W`4hat ya gonna do? (`@[A] T G Y`4)");
  2502.  
  2503.  
  2504.       key=od_get_answer("ATKPRGY\n\r");
  2505.       if (key=='\n' || key=='\r') key='A';
  2506.       od_putch(key);
  2507.       fgc(&enm_num,user_num);
  2508.       if (key=='Y') {
  2509.     DisplayStats();
  2510.     ny_line(1,1,0);
  2511.     od_get_answer("\n\r");
  2512.       }
  2513.     } while (key=='Y');
  2514.  
  2515.     if(key=='R' && user_on->rocks==0) {
  2516.      ny_line(445,2,1);
  2517.      WaitForEnter();
  2518.      goto bam_of2;
  2519.    }
  2520.  
  2521.  
  2522.    if (key == 'T') {  // Take drugs
  2523.      take_drug();
  2524.      no_rip_m=0;
  2525.      key='A';
  2526.    }
  2527.    if (key=='A' || key=='K' || key=='P' || key=='R') {
  2528.      // when atacking
  2529. //   randomize();
  2530.      if(key=='K') {
  2531.        hit_s=random(150 - user_on->kick_ability);
  2532.        if(hit_s<35) {
  2533.      hit_s = (long)user_on->strength * (pow((user_on->level/2)+2,1.2)*6.0*(user_on->kick_ability/100.0)) * (double)((random(80)+90)/100.0);
  2534.      ny_line(439,2,0);
  2535.        } else {
  2536.      hit_s=0;
  2537.      ny_line(440,2,0);
  2538.        }
  2539.      } else if(key=='P') {
  2540.        hit_s=random(140 - user_on->punch_ability);
  2541.        if(hit_s<35) {
  2542.      hit_s = (long)user_on->strength * (pow((user_on->level/2)+2,1.2)*6.0*(user_on->punch_ability/90.0)) * (double)((random(80)+90)/100.0);
  2543.      ny_line(441,2,0);
  2544.        } else {
  2545.      hit_s=0;
  2546.      ny_line(442,2,0);
  2547.        }
  2548.      } else if(key=='R') {
  2549.        hit_s=random(145 - user_on->throwing_ability);
  2550.        user_on->rocks--;
  2551.        if(hit_s<35) {
  2552.      hit_s = (long)user_on->strength * (pow((user_on->level/2)+2,1.2)*6.0*(user_on->throwing_ability/110.0)) * (double)((random(80)+90)/100.0);
  2553.      ny_line(443,2,0);
  2554.        } else {
  2555.      hit_s=0;
  2556.      ny_line(444,2,0);
  2557.        }
  2558.      }
  2559.  
  2560.  
  2561.     /*if (key == 'T') {  // Take drugs
  2562.       take_drug();
  2563.       no_rip_m=0;
  2564.       key='A';
  2565.     }
  2566.     if (key=='A') {-/
  2567.       // when atacking
  2568. //      randomize();
  2569.       if(key=='A')
  2570.     hit_s = user_on->strength * (what_arm_force(user_on->arm)) * (double)((random(80)+80)/100.0);
  2571.     // If he is on drugs
  2572.       if(user_on->drug_high > 0)
  2573.     hit_s = (hit_s * what_drug_force_a(user_on->drug,user_on->drug_high));
  2574.  
  2575. //      hit_s*=pow(1.1,user_on->level);
  2576.  
  2577.       hit_s*=(100.0-(user_on->since_got_laid*2))/100.0;
  2578.       if (user_on->drug>=COKE) hit_s-=random(user_on->drug_days_since * pow((double)user_on->drug_addiction,1.2))/60;
  2579.       if (hit_s<0) hit_s=0;
  2580.  
  2581.       def_s = user_on->defense * what_drug_force_d(user_on->drug,user_on->drug_high) * (double)((random(80)+140)/100.0);
  2582.       def_s*=pow(1.2,user_on->level);
  2583.       def_s*=(100.0-(user_on->since_got_laid*2))/100.0;
  2584.       if (user_on->drug>=COKE) def_s-=random(user_on->drug_days_since * pow(user_on->drug_addiction,1.2))/60;
  2585.       if (def_s<0) def_s=0;
  2586.  
  2587.       def_s/=2;
  2588.  
  2589.       sprintf(numstr,"u%07d.atk",enm_num);
  2590.       justfile = ShareFileOpen(numstr, "wb");
  2591.       ny_fwrite(&hit_s,4,1,justfile);
  2592.       fclose(justfile);
  2593.       sprintf(numstr,"u%07d.atk",enm_num);
  2594.       sprintf(numstr2,"u%07d.on",enm_num);
  2595.       ny_line(222,2,1);
  2596.       //od_printf("\n\r\n`bright red`W`red`aiting....\n\r");
  2597.       t=time(NULL);
  2598.       t2=t;
  2599.  
  2600.       while ((findfirst(numstr,&fff,0)==0) && (findfirst(numstr2,&fff,0)==0)){
  2601.     fgc(&enm_num,user_num);
  2602.     sprintf(numstr,"u%07d.atk",enm_num);
  2603.     sprintf(numstr2,"u%07d.on",enm_num);
  2604.     while(t==t2) {
  2605.       t=time(NULL);
  2606.       od_kernal();
  2607.     }
  2608.     t2=t;
  2609.     od_kernal();
  2610.       }
  2611.  
  2612.       if (findfirst(numstr2,&fff,0)!=0) {
  2613.  
  2614.     ny_line(223,2,1);
  2615.     if(rip) od_get_answer("\n\r");
  2616.     ny_line(224,0,1);
  2617.     //od_printf("\n\r\n`bright red`Y`red`er enemy droped carrier on ya!\n\r`bright red`G`red`o and kill him offline\n\r");
  2618.  
  2619.     ny_remove(numstr);
  2620.     //sprintf(numstr,"del u%07d.atk",enm_num);
  2621.     //system(numstr);
  2622.     sprintf(numstr,"u%07d.fgg",*user_num);
  2623.     ny_remove(numstr);
  2624.     if(!rip) ny_line(1,1,0);
  2625.     od_get_answer("\n\r");
  2626.     return;
  2627.       }
  2628.  
  2629.       intval=erec.hitpoints;
  2630.  
  2631.       sprintf(numstr,"u%07d.sts",enm_num);
  2632.       justfile=ShareFileOpen(numstr,"rb");
  2633.       ny_fread(&erec,sizeof(user_rec),1,justfile);
  2634.       fclose(justfile);
  2635.  
  2636.       intval -= erec.hitpoints;
  2637.  
  2638.       fgc(&enm_num,user_num);
  2639.  
  2640.  
  2641.       ny_line(208,2,0);
  2642.       //od_printf("\n\r\n`bright red`Y`red`a kick `bright green`");
  2643.       ny_disp_emu(erec.name);
  2644.       ny_line(209,0,0);
  2645.       od_printf(D_Num(intval));
  2646.       ny_line(210,0,0);
  2647.  
  2648.      } else if (key=='G') {
  2649.        intval=random(2);
  2650.        if (intval==0) {
  2651.  
  2652.      ny_line(212,2,1);
  2653.   //     od_printf("\n\r\n`bright red`Y`red`a got away ...\n\r");
  2654.  
  2655.      sprintf(numstr,"u%07d.atk",enm_num);
  2656.      justfile = ShareFileOpen(numstr, "wb");
  2657.      intval=-1; //user got away
  2658.      ny_fwrite(&intval,4,1,justfile);
  2659.      fclose(justfile);
  2660.      sprintf(numstr,"u%07d.fgg",*user_num);
  2661.      ny_remove(numstr);
  2662.      if(!rip) ny_line(1,1,0);
  2663.      od_get_answer("\n\r");
  2664.      return;
  2665.        } else {
  2666.  
  2667.      ny_line(213,2,1);
  2668. //     od_printf("\n\r\n`bright red`Y`red`e couldn't find a way outta this ...\n\r");
  2669.  
  2670.      sprintf(numstr,"u%07d.atk",enm_num);
  2671.      justfile = ShareFileOpen(numstr, "wb");
  2672.      intval=-2; ///user couldn't get away
  2673.      ny_fwrite(&intval,4,1,justfile);
  2674.      fclose(justfile);
  2675.      sprintf(numstr,"u%07d.atk",enm_num);
  2676.      sprintf(numstr2,"u%07d.on",enm_num);
  2677.  
  2678.      ny_line(222,2,1);
  2679.      //od_printf("\n\r\n`bright red`W`red`aiting....\n\r");
  2680.  
  2681.      t=time(NULL);
  2682.      t2=t;
  2683.      while ((findfirst(numstr,&fff,0)==0) && (findfirst(numstr2,&fff,0)==0)){
  2684.        fgc(&enm_num,user_num);
  2685.        sprintf(numstr,"u%07d.atk",enm_num);
  2686.        sprintf(numstr2,"u%07d.on",enm_num);
  2687.        while(t==t2) {
  2688.          t=time(NULL);
  2689.          od_kernal();
  2690.        }
  2691.        t2=t;
  2692.        od_kernal();
  2693.      }
  2694.  
  2695.      if (findfirst(numstr2,&fff,0)!=0) {
  2696.  
  2697.        ny_line(223,2,1);
  2698.        if(rip) od_get_answer("\n\r");
  2699.        ny_line(224,0,1);
  2700.        //od_printf("\n\r\n`bright red`Y`red`er enemy droped carrier on ya!\n\r`bright red`G`red`o and kill him offline\n\r");
  2701.  
  2702. //       sprintf(numstr,"del u%07d.atk",enm_num);
  2703. //       system(numstr);
  2704.        ny_remove(numstr);
  2705.        sprintf(numstr,"u%07d.fgg",*user_num);
  2706.        ny_remove(numstr);
  2707.        if(!rip) ny_line(1,1,0);
  2708.        od_get_answer("\n\r");
  2709.        return;
  2710.      }
  2711.        }
  2712.      }*/// else {
  2713.       // DisplayStats();
  2714.      //}
  2715.   } while (1);
  2716. }
  2717.  
  2718.  
  2719.  
  2720.  
  2721.  
  2722. void
  2723. p_fight_ops(user_rec *cur_user,int *user_num)  //This function operates the fights with players
  2724. {
  2725.  
  2726.     char key;  // Menu choice
  2727.  
  2728.     //user_rec cur_user; // The User Record Variable
  2729.     //cur_user *user_on;  // declare allias for the user record
  2730.  
  2731.     do {
  2732.         //key = p_fight(expert);  //Getting the result of menu choice
  2733.         key=callmenu("KYLHTQ?\n\r",P_FIG,354,TRUE);
  2734.         while (key=='?') {
  2735.           expert+=10;
  2736.           key=callmenu("KYLHTQ?\n\r",P_FIG,354,TRUE);
  2737.           expert-=10;
  2738.         }
  2739.  
  2740.         if (key == 'K') {
  2741.           p_attack_ops(cur_user,user_num);
  2742.         } // End of if look
  2743.         else if (key == 'T') {  // Take drugs
  2744.           take_drug();
  2745.         } // End of take drug
  2746.         else if (key == 'H') {
  2747.           ny_line(199,2,0);
  2748. //          od_printf("\n\r\n`bright red`Y`red`a enter the hospital ...\n\r");
  2749.           if(rip) od_get_answer("\n\r");
  2750.           heal_wounds();
  2751.         } // End of healing
  2752.         else if (key == 'Y') {
  2753.           DisplayStats();
  2754.           WaitForEnter();
  2755.         } // End of viewing the stats
  2756.         else if (key=='L') {
  2757.           ListPlayersA();
  2758.         }
  2759.  
  2760.     } while (key != 'Q');   // Do until quit encountered
  2761. }   // end of fight_ops function
  2762.  
  2763.  
  2764.  
  2765.  
  2766. void p_attack_ops(user_rec *user_on,int *nCurrentUserNumber)
  2767. {
  2768.   long hit_s; //the attacking stregth
  2769.   long def_s;
  2770.   long en_hit_s;
  2771.   long en_def_s;
  2772. //  ffblk ffblk;
  2773.   char hand[25];
  2774.   char numstr[25];
  2775.   int unum,ret;
  2776.   FILE *justfile;
  2777.   FILE *scr_file;
  2778.   //enemy_idx eidx;
  2779.   long intval,first,last,moneis;
  2780.   scr_rec urec;
  2781.   user_rec erec;
  2782.   mail_idx_type mail_idx;
  2783. //    enemy erec;
  2784.   char key;
  2785.  
  2786.   if(rip) {
  2787.     od_disp_str("\n\r");
  2788.     od_send_file("texti.rip");
  2789.   }
  2790.  
  2791.  
  2792.   ny_line(233,2,0);
  2793. //  od_printf("\n\r\n`bright red`W`red`ho ya don't like (`bright red`full`red` or `bright red`partial`red` name):`bright green`");
  2794.  
  2795.   od_input_str(hand,24,' ',255);
  2796.   ny_un_emu(hand);
  2797.   od_printf("\n\r");
  2798.   unum=0;
  2799.   ret=1;
  2800.   if (hand[0]!=0) {
  2801.     do {
  2802.       ch_game_d();
  2803.       justfile=ShareFileOpen(SCR_FILENAME,"rb");
  2804.       fseek(justfile,sizeof(scr_rec) * (long)unum,SEEK_SET);
  2805.       do {
  2806.     ret=ny_fread(&urec,sizeof(scr_rec),1,justfile);
  2807.     od_kernal();
  2808.       } while ( ((unum++)==user_on->rank ||
  2809.          strzcmp(hand,ny_un_emu(urec.name,numstr)) ||
  2810.          urec.alive!=ALIVE) &&
  2811.            ret==1);
  2812.       fclose(justfile);
  2813.     } while (ret==1 && askifuser(urec.name)==FALSE);
  2814.   }
  2815.   if (ret!=1) {
  2816.  
  2817.     ny_line(133,1,1);
  2818.     //od_printf("\n\r`bright red`G`red`ot no idea who you mean ...");
  2819.  
  2820.     if(!rip)
  2821.       WaitForEnter();
  2822.     else
  2823.       od_get_answer("\n\r");
  2824.     return;
  2825.   } else if (single_node==FALSE && urec.online==TRUE) {
  2826.     ch_flag_d();
  2827.     sprintf(numstr,"u%07d.fgg",urec.user_num);
  2828.     if (findfirst(numstr,&fff,0)==0) {
  2829.       justfile=ShareFileOpen(numstr,"rb");
  2830.       ny_fread(&intval,2,1,justfile);
  2831.       fclose(justfile);
  2832.       sprintf(numstr,"u%07d.on",intval);
  2833.       if (findfirst(numstr,&fff,0)==0) {
  2834.  
  2835.     ny_line(234,2,1);
  2836. //      od_printf("\n\r\n`bright red`T`red`he user is already being fought!\n\r");
  2837.  
  2838.     if(!rip)
  2839.       WaitForEnter();
  2840.     else
  2841.       od_get_answer("\n\r");
  2842.     return;
  2843.       } else {
  2844.     sprintf(numstr,"u%07d.fgg",urec.user_num);
  2845.     ny_remove(numstr);
  2846.       }
  2847.     }
  2848.     if(expert==3) expert=1;
  2849.     online_fight_a(nCurrentUserNumber,user_on,urec.user_num);
  2850.     return;
  2851.   } else if (hand[0]==0) return;
  2852.  
  2853.   if (user_on->turns <= 0) {
  2854.  
  2855.     ny_line(200,2,1);
  2856.     //od_printf("\n\r\n`bright red`Y`red`a ain't got no fights left ... come back tomorrow\n\r");
  2857.  
  2858.     if(!rip)
  2859.       WaitForEnter();
  2860.     else
  2861.       od_get_answer("\n\r");
  2862.     return;
  2863.   }
  2864.  
  2865.   if(expert==3) expert=1;
  2866.  
  2867.   if(single_node==FALSE) {
  2868.     ch_flag_d();
  2869.     sprintf(numstr,"u%07d.bfa",urec.user_num);
  2870.     if (findfirst(numstr,&fff,0)==0) {
  2871.       justfile=ShareFileOpen(numstr,"rb");
  2872.       ny_fread(&intval,2,1,justfile);
  2873.       fclose(justfile);
  2874.       sprintf(numstr,"u%07d.on",intval);
  2875.       if (findfirst(numstr,&fff,0)==0) {
  2876.  
  2877.     ny_line(234,2,1);
  2878. //      od_printf("\n\r\n`bright red`T`red`he user is already being fought!\n\r");
  2879.  
  2880.     if(!rip)
  2881.       WaitForEnter();
  2882.     else
  2883.       od_get_answer("\n\r");
  2884.     return;
  2885.       } else {
  2886.     sprintf(numstr,"u%07d.bfa",urec.user_num);
  2887.     ny_remove(numstr);
  2888.       }
  2889.     }
  2890.  
  2891.     ch_game_d();
  2892.     sprintf(numstr,"u%07d.inf",urec.user_num);
  2893.     if (findfirst(numstr,&fff,0)==0) {
  2894.  
  2895.       ny_line(235,2,1);
  2896. //    od_printf("\n\r\n`bright red`T`red`he player is somewhere where you can' find him!\n\r");
  2897. //    od_printf(" `red`(Other stuff)\n\r");
  2898.  
  2899.       if(!rip)
  2900.     WaitForEnter();
  2901.       else
  2902.     od_get_answer("\n\r");
  2903.       return;
  2904.     }
  2905.     ch_flag_d();
  2906.  
  2907.     sprintf(numstr,"u%07d.bfo",*nCurrentUserNumber);
  2908.     justfile = ShareFileOpen(numstr, "wb");
  2909.     ny_fwrite(&urec.user_num,2,1,justfile);
  2910.     fclose(justfile);
  2911.  
  2912.     sprintf(numstr,"u%07d.bfa",urec.user_num);
  2913.     justfile = ShareFileOpen(numstr, "wb");
  2914.     ny_fwrite(nCurrentUserNumber,2,1,justfile);
  2915.     fclose(justfile);
  2916.   }
  2917.  
  2918.   //readin the enemy record
  2919.   ch_game_d();
  2920.   justfile=ShareFileOpen(USER_FILENAME,"rb");
  2921.   fseek(justfile,(long)urec.user_num * sizeof(user_rec),SEEK_SET);
  2922.   ny_fread(&erec,sizeof(user_rec),1,justfile);
  2923.   fclose(justfile);
  2924.  
  2925.   // WaitForEnter();
  2926.  
  2927.   if (erec.rest_where==MOTEL) {
  2928.     intval=100*pow(1.4,(double)user_on->level+1);
  2929.  
  2930.     ny_line(236,2,0);
  2931. //    od_printf("\n\r\n`bright red`I`red`t will cost ya `bright green`
  2932.     od_printf(D_Num(intval));
  2933.     ny_line(237,0,0);
  2934. //    `red` to get keys to his room ... Do it?(`bright red`Y`red`/`bright red`N`red`)",intval);
  2935.  
  2936.     key=ny_get_answer("YN");
  2937.     if(!rip)
  2938.       od_printf("%c\n\r",key);
  2939.     else
  2940.       od_disp_str("\n\r");
  2941.  
  2942.     if (key=='N') {
  2943.       if(single_node==FALSE) {
  2944.     ch_flag_d();
  2945.     sprintf(numstr,"u%07d.bfa",urec.user_num);
  2946.     ny_remove(numstr);
  2947.     sprintf(numstr,"u%07d.bfo",*nCurrentUserNumber);
  2948. //    if (findfirst(numstr,&fff,0)==0) {
  2949.     ny_remove(numstr);
  2950. //      sprintf(numstr,"del u%07d.bfo",*nCurrentUserNumber);
  2951. //      system(numstr);
  2952. //    }
  2953.       }
  2954.       return;
  2955.     }
  2956.  
  2957.     if (user_on->money < intval) {
  2958.  
  2959.       ny_line(238,2,1);
  2960. //      od_printf("\n\r\n`bright white`Not nuff money man ...\n\r");
  2961.  
  2962.       if(single_node==FALSE) {
  2963.     ch_flag_d();
  2964.     sprintf(numstr,"u%07d.bfa",urec.user_num);
  2965.     ny_remove(numstr);
  2966.     sprintf(numstr,"u%07d.bfo",*nCurrentUserNumber);
  2967. //    if (findfirst(numstr,&fff,0)==0) {
  2968.     ny_remove(numstr);
  2969. //      sprintf(numstr,"del u%07d.bfo",*nCurrentUserNumber);
  2970. //      system(numstr);
  2971.   //    }
  2972.       }
  2973.       if(!rip)
  2974.     WaitForEnter();
  2975.       else
  2976.     od_get_answer("\n\r");
  2977.       return;
  2978.     }
  2979.     money_minus(intval);
  2980.   } else if (erec.rest_where==REG_HOTEL) {
  2981.     intval=300*pow(1.4,(double)user_on->level+1);
  2982.  
  2983.     ny_line(236,2,0);
  2984.     od_printf(D_Num(intval));
  2985.     ny_line(237,0,0);
  2986.     //od_printf("\n\r\n`bright red`I`red`t will cost ya `bright green`%d`red` to get keys to his room ... Do it?(`bright red`Y`red`/`bright red`N`red`)",intval);
  2987.  
  2988.  
  2989.     key=ny_get_answer("YN");
  2990.     if(!rip)
  2991.       od_printf("%c\n\r",key);
  2992.     else
  2993.       od_disp_str("\n\r");
  2994.  
  2995.     if (key=='N') {
  2996.       if(single_node==FALSE) {
  2997.     ch_flag_d();
  2998.     sprintf(numstr,"u%07d.bfa",urec.user_num);
  2999.     ny_remove(numstr);
  3000.     sprintf(numstr,"u%07d.bfo",*nCurrentUserNumber);
  3001. //    if (findfirst(numstr,&fff,0)==0) {
  3002.     ny_remove(numstr);
  3003. //      sprintf(numstr,"del u%07d.bfo",*nCurrentUserNumber);
  3004. //      system(numstr);
  3005. //    }
  3006.       }
  3007.       return;
  3008.     }
  3009.  
  3010.     if (user_on->money < intval) {
  3011.  
  3012.       ny_line(238,2,1);
  3013.       //od_printf("\n\r\n`bright white`Not nuff money man ...\n\r");
  3014.  
  3015.       if(single_node==FALSE) {
  3016.     ch_flag_d();
  3017.     sprintf(numstr,"u%07d.bfa",urec.user_num);
  3018.     ny_remove(numstr);
  3019.     sprintf(numstr,"u%07d.bfo",*nCurrentUserNumber);
  3020. //    if (findfirst(numstr,&fff,0)==0) {
  3021.     ny_remove(numstr);
  3022. //      sprintf(numstr,"del u%07d.bfo",*nCurrentUserNumber);
  3023. //      system(numstr);
  3024.   //    }
  3025.       }
  3026.       if(!rip)
  3027.     WaitForEnter();
  3028.       else
  3029.     od_get_answer("\n\r");
  3030.       return;
  3031.     }
  3032.     money_minus(intval);
  3033.   } else if (erec.rest_where==EXP_HOTEL) {
  3034.     intval=700*pow(1.4,(double)user_on->level+1);
  3035.  
  3036.     ny_line(236,2,0);
  3037.     od_printf(D_Num(intval));
  3038.     ny_line(237,0,0);
  3039.  
  3040.     //od_printf("\n\r\n`bright red`I`red`t will cost ya `bright green`%d`red` to get keys to his room ... Do it?(`bright red`Y`red`/`bright red`N`red`)",intval);
  3041.  
  3042.     key=ny_get_answer("YN");
  3043.     if(!rip)
  3044.       od_printf("%c\n\r",key);
  3045.     else
  3046.       od_disp_str("\n\r");
  3047.  
  3048.     if (key=='N') {
  3049.       if(single_node==FALSE) {
  3050.     ch_flag_d();
  3051.     sprintf(numstr,"u%07d.bfa",urec.user_num);
  3052.     ny_remove(numstr);
  3053.     sprintf(numstr,"u%07d.bfo",*nCurrentUserNumber);
  3054. //    if (findfirst(numstr,&fff,0)==0) {
  3055.     ny_remove(numstr);
  3056. //      sprintf(numstr,"del u%07d.bfo",*nCurrentUserNumber);
  3057. //      system(numstr);
  3058.       //    }
  3059.       }
  3060.       return;
  3061.     }
  3062.  
  3063.     if (user_on->money < intval) {
  3064.  
  3065.       //od_printf("\n\r\n`bright white`Not nuff money man ...\n\r");
  3066.  
  3067.       if(single_node==FALSE) {
  3068.     ch_flag_d();
  3069.     sprintf(numstr,"u%07d.bfa",urec.user_num);
  3070.     ny_remove(numstr);
  3071.     sprintf(numstr,"u%07d.bfo",*nCurrentUserNumber);
  3072. //    if (findfirst(numstr,&fff,0)==0) {
  3073.       ny_remove(numstr);
  3074. //      sprintf(numstr,"del u%07d.bfo",*nCurrentUserNumber);
  3075. //      system(numstr);
  3076.  //    }
  3077.       }
  3078.       if(!rip)
  3079.     WaitForEnter();
  3080.       else
  3081.     od_get_answer("\n\r");
  3082.       return;
  3083.     }
  3084.     money_minus(intval);
  3085.   }
  3086.   user_on->turns--;
  3087.  
  3088.   //  WaitForEnter();
  3089.   wrt_sts();
  3090.   //  WaitForEnter();
  3091.  
  3092.       od_printf("\n\r\n");
  3093.       ny_clr_scr();
  3094.  
  3095.  
  3096.       ny_line(201,0,0);
  3097. //      od_printf("`bright red`Y`red`ou meet `bright green`");
  3098.       ny_disp_emu(erec.name);
  3099.       ny_line(202,0,2);
  3100. //      od_printf(" `red`...\n\r\n");
  3101.       ny_line(203,0,0);
  3102. //      od_printf("`bright red`H`red`e got a bad lokin' `bright green`");
  3103.       print_arm(erec.arm);
  3104.       ny_line(239,2,0);
  3105. //      od_printf("\n\r\n`bright red`S`red`till wanna do it?(`bright red`Y`red`/`bright red`N`red`)");
  3106.  
  3107.       key=ny_get_answer("YN");
  3108.       od_printf("%c\n\r",key);
  3109.  
  3110.       if (key=='N') {
  3111.         if(single_node==FALSE) {
  3112.           ch_flag_d();
  3113.           sprintf(numstr,"u%07d.bfa",urec.user_num);
  3114.           ny_remove(numstr);
  3115.           sprintf(numstr,"u%07d.bfo",*nCurrentUserNumber);
  3116. //          if (findfirst(numstr,&fff,0)==0) {
  3117.           ny_remove(numstr);
  3118. //        sprintf(numstr,"del u%07d.bfo",*nCurrentUserNumber);
  3119. //        system(numstr);
  3120.   //          }
  3121.         }
  3122.         return;
  3123.       }
  3124.  
  3125.  
  3126.       do {
  3127.  
  3128.         bam_pf:
  3129.         ny_line(240,3,0);
  3130. //        od_printf("\n\r\n\n\r`bright red`P`red`layer `bright red`F`red`ight");
  3131.         ny_disp_emu("\n\r\n`0");
  3132.         ny_disp_emu(erec.name);
  3133.         ny_line(205,0,0);
  3134.         od_printf(D_Num(erec.hitpoints));
  3135.         ny_line(206,1,0);
  3136.         od_printf("%s\n\r\n",D_Num(user_on->hitpoints));
  3137. /*        od_printf("\n\r\n`bright red`[A] `red`- `bright red`A`red`ttack\n\r");
  3138.         od_printf("`bright red`[T] `red`- `bright red`T`red`ake `bright red`D`red`rug `bright red`A`red`nd `bright red`A`red`ttack\n\r");
  3139.         od_printf("`bright red`[G] `red`- `bright red`G`red`et `bright red`O`red`utta `bright red`H`red`ere\n\r");
  3140.         od_printf("`bright red`[Y] `red`- `bright red`Y`red`er `bright red`S`red`tats\n\r");
  3141.         od_printf("\n\r`bright red`W`red`hat ya gonna do? (`bright red`[A] G Y`red`)");*/
  3142.         ny_send_menu(ATTACK,"");
  3143.         ny_line(207,1,0);
  3144. //        ny_disp_emu("\n\r`@W`4hat ya gonna do? (`@[A] T G Y`4)");
  3145.  
  3146.  
  3147.         key=od_get_answer("ATKPRGY\n\r");
  3148.         if (key=='\n' || key=='\r') key='A';
  3149.  
  3150.         od_putch(key);
  3151.  
  3152.         if(key=='R' && user_on->rocks==0) {
  3153.           ny_line(445,2,1);
  3154.           WaitForEnter();
  3155.           goto bam_pf;
  3156.         }
  3157.  
  3158.  
  3159.         if (key == 'T') {  // Take drugs
  3160.           take_drug();
  3161.           no_rip_m=0;
  3162.           key='A';
  3163.         }
  3164.         if (key=='A' || key=='K' || key=='P' || key=='R') {
  3165.         // when atacking
  3166. //          randomize();
  3167.           if(key=='K') {
  3168.         hit_s=random(150 - user_on->kick_ability);
  3169.         if(hit_s<35) {
  3170.           hit_s = (long)user_on->strength * (pow((user_on->level/2)+2,1.2)*6.0*(user_on->kick_ability/100.0)) * (double)((random(80)+90)/100.0);
  3171.           ny_line(439,2,0);
  3172.         } else {
  3173.           hit_s=0;
  3174.           ny_line(440,2,0);
  3175.         }
  3176.           } else if(key=='P') {
  3177.         hit_s=random(140 - user_on->punch_ability);
  3178.         if(hit_s<35) {
  3179.           hit_s = (long)user_on->strength * (pow((user_on->level/2)+2,1.2)*6.0*(user_on->punch_ability/90.0)) * (double)((random(80)+90)/100.0);
  3180.           ny_line(441,2,0);
  3181.         } else {
  3182.           hit_s=0;
  3183.           ny_line(442,2,0);
  3184.         }
  3185.           } else if(key=='R') {
  3186.         hit_s=random(145 - user_on->throwing_ability);
  3187.         user_on->rocks--;
  3188.         if(hit_s<35) {
  3189.           hit_s = (long)user_on->strength * (pow((user_on->level/2)+2,1.2)*6.0*(user_on->throwing_ability/110.0)) * (double)((random(80)+90)/100.0);
  3190.           ny_line(443,2,0);
  3191.         } else {
  3192.           hit_s=0;
  3193.           ny_line(444,2,0);
  3194.         }
  3195.          }
  3196.  
  3197.         /*if (key == 'T') {  // Take drugs
  3198.           take_drug();
  3199.           no_rip_m=0;
  3200.           key='A';
  3201.         }
  3202.         if (key=='A') {*/
  3203.           // when atacking
  3204. //          randomize();
  3205.         attack_again_p:
  3206.         if(key=='A')
  3207.           hit_s = user_on->strength * (what_arm_force(user_on->arm)) * (double)((random(80)+80)/100.0);
  3208.         // If he is on drugs
  3209.         if(user_on->drug_high > 0)
  3210.           hit_s = (hit_s * what_drug_force_a(user_on->drug,user_on->drug_high));
  3211.  
  3212. //        hit_s*=pow(1.1,user_on->level);
  3213.  
  3214.         hit_s*=(100.0-(user_on->since_got_laid*2))/100.0;
  3215.         if (user_on->drug>=COKE) hit_s-=random(user_on->drug_days_since * pow((double)user_on->drug_addiction,1.2))/60;
  3216.         if (hit_s<0) hit_s=0;
  3217.  
  3218.         en_hit_s = erec.strength * (what_arm_force(erec.arm)) * (double)((random(70)+60)/100.0);
  3219. //        en_hit_s*=pow(1.1,erec.level);
  3220.  
  3221.         en_hit_s*=(100.0-(erec.since_got_laid*2))/100.0;
  3222.         if (erec.drug>=COKE) en_hit_s-=random(erec.drug_days_since * pow((double)erec.drug_addiction,1.2))/60;
  3223.         if (en_hit_s<0) en_hit_s=0;
  3224.  
  3225.         def_s = user_on->defense * what_drug_force_d(user_on->drug,user_on->drug_high) * (double)((random(80)+140)/100.0);
  3226.         def_s*=pow(1.2,user_on->level);
  3227.         def_s*=(100.0-(user_on->since_got_laid*2))/100.0;
  3228.         if (user_on->drug>=COKE) def_s-=random(user_on->drug_days_since * pow(user_on->drug_addiction,1.2))/60;
  3229.         if (def_s<0) def_s=0;
  3230.  
  3231.         en_def_s = erec.defense * (double)((random(80)+120)/100.0);
  3232.         en_def_s*=pow(1.2,erec.level);
  3233.         en_def_s*=(100.0-(erec.since_got_laid*2))/100.0;
  3234.         if (erec.drug>=COKE) en_def_s-=random(erec.drug_days_since * pow(erec.drug_addiction,1.2))/60;
  3235.         if (en_def_s<0) en_def_s=0;
  3236.  
  3237.         def_s/=2;
  3238.         en_def_s/=2;
  3239.  
  3240.         en_hit_s-=def_s;
  3241.         if (en_hit_s<0) en_hit_s=0;
  3242.  
  3243.         hit_s-=en_def_s;
  3244.         if (hit_s<0) hit_s=0;
  3245.  
  3246.         if (hit_s==0 && en_hit_s==0 && key=='A') goto attack_again_p;
  3247.  
  3248.         erec.hitpoints-=hit_s;
  3249.  
  3250.  
  3251.         ny_line(208,2,0);
  3252. //        od_printf("\n\r\n`bright red`Y`red`a kick `bright green`");
  3253.         ny_disp_emu(erec.name);
  3254.         ny_line(209,0,0);
  3255.         od_printf(D_Num(hit_s));
  3256.         ny_line(210,0,0);
  3257.  
  3258.  
  3259.         if (erec.hitpoints>0) {
  3260.  
  3261.           ny_disp_emu("\n\r\n`0");
  3262.           ny_disp_emu(erec.name);
  3263.           ny_line(211,0,0);
  3264.           od_printf(D_Num(en_hit_s));
  3265.           ny_line(210,0,0);
  3266.  
  3267.  
  3268.           user_on->hitpoints-=en_hit_s;
  3269.           wrt_sts();
  3270.           if (user_on->hitpoints<=0) {
  3271.  
  3272.         od_printf("\n\r\n");
  3273.         ny_send_menu(ASS_KICKED_P,"");
  3274. //        od_printf("\n\r\n`bright white`You had yer ass kicked ... oh well that happens\n\rCome back tomorrow to get revenge ...\n\rYa lost 8%c of yer points\n\r",37);
  3275.  
  3276.         news_post(user_on->say_loose,user_on->name,erec.name,5);
  3277.         user_on->alive=UNCONCIOUS;
  3278.         user_on->money=0;
  3279.         points_loose(user_on->points*.08);
  3280.         //wrt_sts();
  3281.         if(single_node==FALSE) {
  3282.           ch_flag_d();
  3283.           sprintf(numstr,"u%07d.bfa",urec.user_num);
  3284.           ny_remove(numstr);
  3285.           sprintf(numstr,"u%07d.bfo",*nCurrentUserNumber);
  3286. //          if (findfirst(numstr,&fff,0)==0) {
  3287.           ny_remove(numstr);
  3288. //            sprintf(numstr,"del u%07d.bfo",*nCurrentUserNumber);
  3289. //            system(numstr);
  3290.   //          }
  3291.         }
  3292.         WaitForEnter();
  3293.         od_exit(10,FALSE);
  3294.           }
  3295.         }
  3296.       } else if (key=='G') {
  3297.         intval=random(2);
  3298.         if (intval==0) {
  3299.  
  3300.           ny_line(212,2,1);
  3301.           //od_printf("\n\r\n`bright red`Y`red`a got away ...\n\r");
  3302.  
  3303.           if(single_node==FALSE) {
  3304.         ch_flag_d();
  3305.         sprintf(numstr,"u%07d.bfa",urec.user_num);
  3306.         ny_remove(numstr);
  3307.         sprintf(numstr,"u%07d.bfo",*nCurrentUserNumber);
  3308. //        if (findfirst(numstr,&fff,0)==0) {
  3309.         ny_remove(numstr);
  3310. //          sprintf(numstr,"del u%07d.bfo",*nCurrentUserNumber);
  3311. //          system(numstr);
  3312.         //}
  3313.           }
  3314.           if(!rip)
  3315.         WaitForEnter();
  3316.           else
  3317.         od_get_answer("\n\r");
  3318.           return;
  3319.         } else {
  3320.  
  3321.           ny_line(213,2,1);
  3322. //          od_printf("\n\r\n`bright red`Y`red`e couldn't find a way outta this ...\n\r");
  3323.  
  3324. //          randomize();
  3325.           en_hit_s = erec.strength * (what_arm_force(erec.arm)) * (double)((random(80)+80)/100.0);
  3326. //          en_hit_s*=pow(1.1,erec.level);
  3327.  
  3328.           en_hit_s*=(100.0-(erec.since_got_laid*2))/100.0;
  3329.           if (erec.drug>=COKE) en_hit_s-=random(erec.drug_days_since * pow((double)erec.drug_addiction,1.2))/60;
  3330.           if (en_hit_s<0) en_hit_s=0;
  3331.  
  3332.           def_s = user_on->defense * what_drug_force_d(user_on->drug,user_on->drug_high) * (double)((random(80)+140)/100.0);
  3333.           def_s*=pow(1.2,user_on->level);
  3334.           def_s*=(100.0-(user_on->since_got_laid*2))/100.0;
  3335.           if (user_on->drug>=COKE) def_s-=random(user_on->drug_days_since * pow(user_on->drug_addiction,1.2))/60;
  3336.           if (def_s<0) def_s=0;
  3337.  
  3338.           def_s/=2;
  3339.           en_hit_s-=def_s;
  3340.           if (en_hit_s<0) en_hit_s=0;
  3341.  
  3342.           ny_disp_emu("\n\r\n`0");
  3343.           ny_disp_emu(erec.name);
  3344.           ny_line(211,0,0);
  3345.           od_printf(D_Num(en_hit_s));
  3346.           ny_line(210,0,0);
  3347.  
  3348.  
  3349.           user_on->hitpoints-=en_hit_s;
  3350.           wrt_sts();
  3351.           if (user_on->hitpoints<=0) {
  3352.  
  3353.         od_printf("\n\r\n");
  3354.         ny_send_menu(ASS_KICKED_P,"");
  3355.  
  3356.         //od_printf("\n\r\n`bright white`You had yer ass kicked ... oh well that happens\n\rCome back tomorrow to get revenge ...\n\rYa lost 8%c of yer points\n\r",37);
  3357.  
  3358.         news_post(user_on->say_loose,user_on->name,erec.name,5);
  3359.         user_on->alive=UNCONCIOUS;
  3360.         user_on->money=0;
  3361.         points_loose(user_on->points*.08);
  3362.         //wrt_sts();
  3363.         if(single_node==FALSE) {
  3364.           ch_flag_d();
  3365.           sprintf(numstr,"u%07d.bfa",urec.user_num);
  3366.           ny_remove(numstr);
  3367.           sprintf(numstr,"u%07d.bfo",*nCurrentUserNumber);
  3368. //          if (findfirst(numstr,&fff,0)==0) {
  3369.           ny_remove(numstr);
  3370. //            sprintf(numstr,"del u%07d.bfo",*nCurrentUserNumber);
  3371. //            system(numstr);
  3372.           //}
  3373.         }
  3374.         WaitForEnter();
  3375.         od_exit(10,FALSE);
  3376.           }
  3377.         }
  3378.       } else {
  3379.         DisplayStats();
  3380.         WaitForEnter();
  3381.       }
  3382.     } while (erec.hitpoints>0);
  3383.  
  3384.  
  3385.     ny_line(214,2,0);
  3386.     //od_printf("\n\r\n`bright red`Y`red`ou kicked `bright green`");
  3387.     ny_disp_emu(erec.name);
  3388.     ny_line(215,0,2);
  3389.     //od_printf("'s `red`ass ...\n\r\n");
  3390.     money_plus(erec.money);
  3391.     ny_line(216,0,0);
  3392.     od_printf(D_Num(erec.money));
  3393.     intval=.08*erec.points;
  3394.     ny_line(217,0,0);
  3395.     od_printf(D_Num((unsigned long)intval * (unsigned long)DrgPtsCoef()));
  3396.     ny_line(218,0,1);
  3397.  
  3398.     points_raise(intval);
  3399.  
  3400.  
  3401.  
  3402.  
  3403.     erec.money=0;
  3404.  
  3405.     erec.alive=UNCONCIOUS;
  3406.     urec.alive=UNCONCIOUS;
  3407.  
  3408.     if (erec.arm>user_on->arm) {
  3409.  
  3410.       ny_line(228,2,0);
  3411.   //      od_printf("\n\r\n`bright red`D`red`o ya wanna swap weapons with`bright green` ");
  3412.       if(!rip)
  3413.         ny_disp_emu(erec.name);
  3414.       else
  3415.         od_disp_str(ny_un_emu(erec.name,numstr));
  3416.       ny_line(79,0,0);
  3417. //      ny_disp_emu("`4? (`@Y`4/`@N`4)");
  3418.  
  3419.       key=od_get_answer("YN");
  3420.       if(!rip)
  3421.         od_printf("%c\n\r",key);
  3422.       else
  3423.         od_disp_str("\n\r");
  3424.       if (key=='Y') {
  3425.  
  3426.         weapon tarm;
  3427.  
  3428.         tarm=erec.arm;
  3429.         erec.arm=user_on->arm;
  3430.         user_on->arm=tarm;
  3431.  
  3432.         ny_line(229,1,0);
  3433. //        od_printf("\n\r`bright red`D`red`one! `bright red`Y`red`ou now got the `bright green`");
  3434.  
  3435.         print_arm(user_on->arm);
  3436.         if(rip) {
  3437.           od_disp_str("::^M@OK))|#|#|#\n\r\n");
  3438.           od_get_answer("\n\r");
  3439.         }
  3440.         od_printf("\n\r\n");
  3441.       }
  3442.     }
  3443.  
  3444.  
  3445.  
  3446.  
  3447. /*    strcpy(urec.name,user_on.name);
  3448.     rec.nation=cur_user.nation;
  3449.     rec.level=cur_user.level;
  3450.     rec.points=cur_user.points;
  3451.     rec.alive=cur_user.alive;
  3452.     rec.sex=cur_user.sex;
  3453.     rec.user_num=nCurrentUserNumber;
  3454.     rec.online=TRUE;*/
  3455.  
  3456.     if(single_node==FALSE) {
  3457.       ch_flag_d();
  3458.       sprintf(numstr,"u%07d.bfo",*nCurrentUserNumber);
  3459.  
  3460.       if (findfirst(numstr,&fff,0)==0) {
  3461.         justfile=ShareFileOpen(numstr,"rb");
  3462.         ny_fread(&urec.user_num,2,1,justfile);
  3463.         fclose(justfile);
  3464.  
  3465.         ny_remove(numstr);
  3466.  
  3467. //        sprintf(numstr,"del u%07d.bfo",*nCurrentUserNumber);
  3468. //        system(numstr);
  3469.       }
  3470.     }
  3471.  
  3472.     erec.points*=.92;
  3473.     urec.points*=.92;
  3474.  
  3475.     SortScrFileB(urec.user_num);
  3476.  
  3477.     user_rec serec;
  3478.  
  3479.     ch_game_d();
  3480.  
  3481.     justfile=ShareFileOpen(USER_FILENAME,"rb");
  3482.     fseek(justfile,(long)urec.user_num*sizeof(user_rec),SEEK_SET);
  3483.     ny_fread(&serec,sizeof(user_rec),1,justfile);
  3484.     fclose(justfile);
  3485.  
  3486.  
  3487.     scr_file=ShareFileOpen(SCR_FILENAME,"r+b");
  3488.     fseek(scr_file, (long)serec.rank * sizeof(scr_rec), SEEK_SET);
  3489.     ny_fwrite(&urec, sizeof(scr_rec), 1, scr_file);
  3490.     fclose(scr_file);
  3491.  
  3492.     erec.rank=serec.rank;
  3493.  
  3494.  
  3495.  
  3496.     justfile=ShareFileOpen(USER_FILENAME,"r+b");
  3497.     fseek(justfile,(long)urec.user_num*sizeof(user_rec),SEEK_SET);
  3498.     ny_fwrite(&erec,sizeof(user_rec),1,justfile);
  3499.     fclose(justfile);
  3500.  
  3501.  
  3502. //
  3503. //    od_printf("\n\r\n`bright red`Y`red`ou kicked `bright green`%s's `red`ass ...\n\r",erec.name);
  3504. //
  3505.  
  3506.     strcpy(mail_idx.recver,erec.name);
  3507.     strcpy(mail_idx.sender,user_on->name);
  3508.     strcpy(mail_idx.recverI,erec.bbsname);
  3509.     strcpy(mail_idx.senderI,user_on->bbsname);
  3510.     mail_idx.flirt=1001;
  3511.     mail_idx.deleted=FALSE;
  3512.     mail_idx.location=0;
  3513.     mail_idx.length=0;
  3514.     mail_idx.afterquote=0;
  3515.     mail_idx.ill=user_on->std;
  3516.     mail_idx.inf=user_on->std_percent;
  3517.     mail_idx.sender_sex=user_on->sex;
  3518.     ch_game_d();
  3519.  
  3520.     justfile=ShareFileOpen(MAIL_INDEX,"a+b");
  3521.     ny_fwrite(&mail_idx,sizeof(mail_idx_type),1,justfile);
  3522.     fclose(justfile);
  3523.  
  3524.  
  3525.  
  3526.     if (erec.sex!=user_on->sex && clean_mode==FALSE && user_on->sex_today>0) {
  3527.  
  3528.       ny_line(230,2,0);
  3529. //      od_printf("\n\r\n`bright red`D`red`o ya wanna rape `bright green`");
  3530.       ny_disp_emu(erec.name);
  3531.       ny_line(79,0,0);
  3532. //      ny_disp_emu("`4? (`@Y`4/`@N`4)");
  3533.  
  3534.       key=od_get_answer("YN");
  3535.       if(!rip)
  3536.         od_printf("%c\n\r",key);
  3537.       else
  3538.         od_disp_str("\n\r");
  3539.       if (key=='Y') {
  3540.         if (user_on->sex_today<=0) {
  3541.  
  3542.           ny_line(118,2,1);
  3543. //          od_printf("\n\r\n`bright white`You already used up all your sex turns today ...\n\r");
  3544.  
  3545.         } else {
  3546.           strcpy(mail_idx.recver,erec.name);
  3547.           strcpy(mail_idx.sender,user_on->name);
  3548.           strcpy(mail_idx.recverI,erec.bbsname);
  3549.           strcpy(mail_idx.senderI,user_on->bbsname);
  3550.           mail_idx.flirt=1000;
  3551.           mail_idx.deleted=FALSE;
  3552.           mail_idx.location=0;
  3553.           mail_idx.length=0;
  3554.           mail_idx.afterquote=0;
  3555.           mail_idx.ill=user_on->std;
  3556.           mail_idx.inf=user_on->std_percent;
  3557.           mail_idx.sender_sex=user_on->sex;
  3558.           ch_game_d();
  3559.           justfile=ShareFileOpen(MAIL_INDEX,"a+b");
  3560.           ny_fwrite(&mail_idx,sizeof(mail_idx_type),1,justfile);
  3561.           fclose(justfile);
  3562.           user_on->sex_today--;
  3563.           user_on->since_got_laid=0;
  3564.           ny_line(339,1,0);
  3565.           if(rip)
  3566.         ny_disp_emu(erec.name);
  3567.           else
  3568.         od_disp_str(ny_un_emu(erec.name,numstr));
  3569.           ny_line(340,0,1);
  3570.           if(rip)
  3571.         od_get_answer("\n\r");
  3572.  
  3573.           illness(erec.std,erec.std_percent);
  3574.           points_raise((long)35*(user_on->level+1));
  3575.  
  3576.         }
  3577.       }
  3578.     }
  3579.  
  3580.     news_post(user_on->say_win,user_on->name,erec.name,4);
  3581.     if(single_node==FALSE) {
  3582.       ch_flag_d();
  3583.  
  3584.       sprintf(numstr,"u%07d.bfa",urec.user_num);
  3585.       ny_remove(numstr);
  3586.  
  3587.  
  3588.       sprintf(numstr,"u%07d.bfo",*nCurrentUserNumber);
  3589.       ny_remove(numstr);
  3590.     }
  3591.  
  3592.     if(!rip) WaitForEnter();
  3593. } // end of function p_attack_ops
  3594.  
  3595. void evil_ops(user_rec *cur_user)
  3596. {
  3597.   char key;
  3598.   long chance,intval;
  3599.  
  3600.   do {
  3601.     key=callmenu("SBPDRWQ?\n\r",EVIL_STUFF,355,FALSE);
  3602.     while (key=='?') {
  3603.       expert+=10;
  3604.       key=callmenu("SBPDRWQ?\n\r",EVIL_STUFF,355,FALSE);
  3605.       expert-=10;
  3606.     }
  3607.  
  3608.     if (key=='S') {  //steel money from beggars
  3609.       if(rip) no_rip_m=1;
  3610.  
  3611.       ny_line(241,2,1);
  3612. //      od_printf("\n\r\n`bright red`Y`red`ou find some blind beggar and try to take some of his money...\n\r");
  3613.  
  3614.       if(!rip)
  3615.     WaitForEnter();
  3616.       else
  3617.     od_get_answer("\n\r");
  3618.       chance=random(100);
  3619.       if (chance<=busted_ch_beggar) {
  3620.  
  3621.     od_printf("\n\r\n");
  3622.     ny_send_menu(BUSTED,"");
  3623.     //od_printf("\n\r\n`bright white`BUSTED!!!! .... well the police beat the hell out of you .....");
  3624.     //od_printf("\n\rWhy don't you try again tomorrow...\n\r");
  3625.     //od_printf("Ya lost 2%c of yer points!\n\r",37);
  3626.  
  3627.     cur_user->alive=UNCONCIOUS;
  3628.     points_loose(cur_user->points*.02);
  3629.     news_post("stealing from beggars",cur_user->name,"",2);
  3630.     if(!rip)
  3631.       WaitForEnter();
  3632.     else
  3633.       od_get_answer("\n\r");
  3634.     od_exit(10,FALSE);
  3635.       } else {
  3636.     chance=random(100);
  3637.     if (chance<=success_ch_beggar) {
  3638.       intval=random((cur_user->level+1)*30);
  3639.  
  3640.       ny_line(242,2,0);
  3641. //      od_printf("\n\r\n`bright red`Y`red`ou just stole
  3642.       od_printf(D_Num(intval));
  3643.       ny_line(243,0,1);
  3644. //      from the poor bastard, good job...\n\r",intval);
  3645.  
  3646.       money_plus(intval);
  3647.       points_raise((long)20*cur_user->level+15);
  3648.       if(!rip)
  3649.         WaitForEnter();
  3650.       else
  3651.         od_get_answer("\n\r");
  3652.     } else {
  3653.  
  3654.       ny_line(244,2,1);
  3655.       //od_printf("\n\r\n`bright red`T`red`he poor bastard was broke...\n\r");
  3656.  
  3657.       if(!rip)
  3658.         WaitForEnter();
  3659.       else
  3660.         od_get_answer("\n\r");
  3661.     }
  3662.       }
  3663.     }
  3664.     if (key=='D') {  //destroy a car
  3665.       if(rip) no_rip_m=1;
  3666.  
  3667.       ny_line(184,2,1);
  3668.       //od_printf("\n\r\n`bright red`Y`red`ou find a nice car...\n\r");
  3669.  
  3670.       if(!rip)
  3671.     WaitForEnter();
  3672.       else
  3673.     od_get_answer("\n\r");
  3674.       chance=random(100);
  3675.       if (chance<=busted_ch_car) {
  3676.  
  3677.     od_printf("\n\r\n");
  3678.     ny_send_menu(BUSTED,"");
  3679.     //od_printf("\n\r\n`bright white`BUSTED!!!! .... well the police beat the hell out of you .....");
  3680.     //od_printf("\n\rWhy don't you try again tomorrow...\n\r");
  3681.     //od_printf("Ya lost 2%c of yer points!\n\r",37);
  3682.  
  3683.     cur_user->alive=UNCONCIOUS;
  3684.     points_loose(cur_user->points*.02);
  3685.     news_post("busting up a car",cur_user->name,"",2);
  3686.     if(!rip)
  3687.       WaitForEnter();
  3688.     else
  3689.       od_get_answer("\n\r");
  3690.     od_exit(10,FALSE);
  3691.       } else {
  3692.     chance=random(100);
  3693.     if(chance<=success_ch_car) {
  3694.  
  3695.       ny_line(192,2,1);
  3696. //      od_printf("\n\r\n`bright red`Y`red`ou totally smashed that car .... a very nice job...\n\r");
  3697.       if(rip) od_get_answer("\n\r");
  3698.       ny_line(117,0,0);
  3699.       od_printf("%s",D_Num((long)(25*cur_user->level+25) * (long)DrgPtsCoef()));
  3700.  
  3701.       points_raise((long)25*cur_user->level+25);
  3702.       if(!rip) {
  3703.         WaitForEnter();
  3704.         od_disp_str("\n\r");
  3705.       } else {
  3706.         od_disp_str("::^M@OK))|#|#|#\n\r");
  3707.         od_get_answer("\n\r");
  3708.       }
  3709.     } else {
  3710.  
  3711.       ny_line(406,2,1);
  3712.  
  3713.       if(!rip)
  3714.         WaitForEnter();
  3715.       else
  3716.         od_get_answer("\n\r");
  3717.     }
  3718.       }
  3719.     }
  3720.     if (key=='B') {  //burn a school down
  3721.       if(rip) no_rip_m=1;
  3722.  
  3723.       ny_line(245,2,1);
  3724. //      od_printf("\n\r\n`bright red`Y`red`ou find a school...that's the easy part...\n\r");
  3725.  
  3726.       if(!rip)
  3727.     WaitForEnter();
  3728.       else
  3729.     od_get_answer("\n\r");
  3730.       chance=random(100);
  3731.       if (chance<=busted_ch_school) {
  3732.  
  3733.     od_printf("\n\r\n");
  3734.     ny_send_menu(BUSTED,"");
  3735.     //od_printf("\n\r\n`bright white`BUSTED!!!! .... well the police beat the hell out of you .....");
  3736.     //od_printf("\n\rWhy don't you try again tomorrow...\n\r");
  3737.     //od_printf("Ya lost 2%c of yer points!\n\r",37);
  3738.  
  3739.     cur_user->alive=UNCONCIOUS;
  3740.     points_loose(cur_user->points*.02);
  3741.     news_post("burning down a school",cur_user->name,"",2);
  3742.     if(!rip)
  3743.       WaitForEnter();
  3744.     else
  3745.       od_get_answer("\n\r");
  3746.     od_exit(10,FALSE);
  3747.       } else {
  3748.     chance=random(100);
  3749.     if (chance<=success_ch_school) {
  3750.  
  3751.       ny_line(246,2,1);
  3752.       if(rip) od_get_answer("\n\r");
  3753. //      od_printf("\n\r\n`bright red`I`red`t looks lovely as the school buildings crumble into ashes ...\n\r");
  3754.       ny_line(117,0,0);
  3755.       od_printf("%s",D_Num((long)(50*cur_user->level+40) * (long)DrgPtsCoef()));
  3756.  
  3757.       points_raise((long)50*cur_user->level+40);
  3758.       news_post("`@A`4 school burned to ashes ... `%Police `4say clear case of arsen","","",0);
  3759.       if(!rip) {
  3760.         od_disp_str("\n\r");
  3761.         WaitForEnter();
  3762.       } else {
  3763.         od_disp_str("::^M@OK))|#|#|#\n\r");
  3764.         od_get_answer("\n\r");
  3765.       }
  3766.     } else {
  3767.  
  3768.       ny_line(247,2,1);
  3769.       //od_printf("\n\r\n`bright red`S`red`chools don't burn very well... all matches are gone...\n\r");
  3770.  
  3771.       if(!rip)
  3772.         WaitForEnter();
  3773.       else
  3774.         od_get_answer("\n\r");
  3775.     }
  3776.       }
  3777.     }
  3778.     if (key=='R') {  //break a window
  3779.       if(rip) no_rip_m=1;
  3780.  
  3781.       ny_line(248,2,1);
  3782.       //od_printf("\n\r\n`bright red`Y`red`ou pick up a rock and...\n\r");
  3783.  
  3784.       if(!rip)
  3785.     WaitForEnter();
  3786.       else
  3787.     od_get_answer("\n\r");
  3788.       chance=random(100);
  3789.       if (chance<=busted_ch_window) {
  3790.  
  3791.     od_printf("\n\r\n");
  3792.     ny_send_menu(BUSTED,"");
  3793.     //od_printf("\n\r\n`bright white`BUSTED!!!! .... well the police beat the hell out of you .....");
  3794.     //od_printf("\n\rWhy don't you try again tomorrow...\n\r");
  3795.     //od_printf("Ya lost 2%c of yer points!\n\r",37);
  3796.  
  3797.     cur_user->alive=UNCONCIOUS;
  3798.     points_loose(cur_user->points*.02);
  3799.     news_post("breaking windows",cur_user->name,"",2);
  3800.     if(!rip)
  3801.       WaitForEnter();
  3802.     else
  3803.       od_get_answer("\n\r");
  3804.     od_exit(10,FALSE);
  3805.       } else {
  3806.     chance=random(100);
  3807.     if(chance<=success_ch_window) {
  3808.  
  3809.       ny_line(249,2,1);
  3810.       if(rip) od_get_answer("\n\r");
  3811. //      od_printf("\n\r\n`bright red`B`red`reaking glass sounds so good...\n\r");
  3812.       ny_line(117,0,0);
  3813.       od_printf("%s",D_Num((long)(8*cur_user->level+8) * (long)DrgPtsCoef()));
  3814.  
  3815.       points_raise((long)8 * cur_user->level + 8);
  3816.       if(!rip) {
  3817.         od_disp_str("\n\r");
  3818.         WaitForEnter();
  3819.       } else {
  3820.         od_disp_str("::^M@OK))|#|#|#\n\r");
  3821.         od_get_answer("\n\r");
  3822.       }
  3823.     } else {
  3824.  
  3825.       ny_line(407,2,1);
  3826.  
  3827.       if(!rip)
  3828.         WaitForEnter();
  3829.       else
  3830.         od_get_answer("\n\r");
  3831.     }
  3832.       }
  3833.     }
  3834.     if (key=='P') {  //poison
  3835.       if(rip) no_rip_m=1;
  3836.       intval=pow(1.6,cur_user->level) * 500;
  3837.  
  3838.       ny_line(250,2,0);
  3839.       od_printf(D_Num(intval));
  3840. //      od_printf("\n\r\n`bright red`P`red`oisoning water will cost ya `bright red`%s`red` ... Do it(`bright red`Y`red`/`bright red`N`red`)",D_Num(intval));
  3841.       ny_line(251,0,0);
  3842.  
  3843.       key=ny_get_answer("YN");
  3844.       if(!rip) od_putch(key);
  3845.       if (key=='Y' && cur_user->poison<=0) {
  3846.     ny_line(182,2,1);
  3847.     if(!rip)
  3848.       WaitForEnter();
  3849.     else
  3850.       od_get_answer("\n\r");
  3851.       } else if (key=='Y') {
  3852.     if (cur_user->money < intval) {
  3853.  
  3854.       ny_line(252,2,1);
  3855. //      od_printf("\n\r\n`bright red`Y`red`a cant afford it man...\n\r");
  3856.  
  3857.       if(!rip)
  3858.         WaitForEnter();
  3859.       else
  3860.         od_get_answer("\n\r");
  3861.     } else {
  3862.       money_minus(intval);
  3863.  
  3864.       ny_line(253,2,1);
  3865.       //od_printf("\n\r\n`bright red`Y`red`ou buy enough poison and dump it into the water...\n\r");
  3866.  
  3867.       cur_user->poison--;
  3868.       if(!rip)
  3869.         WaitForEnter();
  3870.       else
  3871.         od_get_answer("\n\r");
  3872.       chance=random(100);
  3873.       if (chance<=busted_ch_poison) {
  3874.  
  3875.         od_printf("\n\r\n");
  3876.         ny_send_menu(BUSTED,"");
  3877.         //od_printf("\n\r\n`bright white`BUSTED!!!! .... well the police beat the hell out of you .....");
  3878.         //od_printf("\n\rWhy don't you try again tomorrow...\n\r");
  3879.         //od_printf("Ya lost 2%c of yer points!\n\r",37);
  3880.  
  3881.         cur_user->alive=UNCONCIOUS;
  3882.         points_loose(cur_user->points*.02);
  3883.         news_post("poisoning water",cur_user->name,"",2);
  3884.         if(!rip)
  3885.           WaitForEnter();
  3886.         else
  3887.           od_get_answer("\n\r");
  3888.         od_exit(10,FALSE);
  3889.       } else {
  3890.         chance=random(100);
  3891.         if (chance<=success_ch_poison) {
  3892.  
  3893.           ny_line(254,2,1);
  3894.           if(rip) od_get_answer("\n\r");
  3895.           //od_printf("\n\r\n`bright red`W`red`ow lotsa dead folks ... It worked ...\n\r");
  3896.           ny_line(117,0,0);
  3897.           od_printf("%s",D_Num((long)(80*cur_user->level+60) * (long)DrgPtsCoef()));
  3898.  
  3899.           points_raise((long)80*cur_user->level+60);
  3900.           news_post("`@W`4ater was poisoned today ... `%nobody was caught","","",0);
  3901.           if(!rip) {
  3902.         od_disp_str("\n\r");
  3903.         WaitForEnter();
  3904.           } else {
  3905.         od_disp_str("::^M@OK))|#|#|#\n\r");
  3906.         od_get_answer("\n\r");
  3907.           }
  3908.         } else {
  3909.  
  3910.           ny_line(255,2,1);
  3911.           //od_printf("\n\r\n`bright red`T`red`he poison didn't work ... The guy ripped you off ...\n\r");
  3912.  
  3913.           if(!rip)
  3914.         WaitForEnter();
  3915.           else
  3916.         od_get_answer("\n\r");
  3917.         }
  3918.       }
  3919.     }
  3920.       }
  3921.     }
  3922.     if (key=='W') {  //WTC bombing
  3923.       if(rip) no_rip_m=1;
  3924.       intval=pow(1.6,cur_user->level) * 1000;
  3925.  
  3926.       ny_line(256,2,0);
  3927.       od_printf(D_Num(intval));
  3928.       ny_line(251,0,0);
  3929. //      od_printf("\n\r\n`bright red`E`red`xplosives will cost ya `bright red`%s`red` ... Do it(`bright red`Y`red`/`bright red`N`red`)",D_Num(intval));
  3930.  
  3931.       key=ny_get_answer("YN");
  3932.       if(!rip) od_putch(key);
  3933.       if (key=='Y' && cur_user->wtc<=0) {
  3934.     ny_line(181,2,1);
  3935.     if(!rip)
  3936.       WaitForEnter();
  3937.     else
  3938.       od_get_answer("\n\r");
  3939.       } else if (key=='Y') {
  3940.     if (cur_user->money < intval) {
  3941.  
  3942.       ny_line(252,2,1);
  3943.       //od_printf("\n\r\n`bright red`Y`red`a cant afford it man...\n\r");
  3944.  
  3945.       if(!rip)
  3946.         WaitForEnter();
  3947.       else
  3948.         od_get_answer("\n\r");
  3949.     } else {
  3950.       money_minus(intval);
  3951.  
  3952.       ny_line(257,2,1);
  3953. //      od_printf("\n\r\n`bright red`Y`red`ou buy nuff explosives and ...\n\r");
  3954.  
  3955.       cur_user->wtc--;
  3956.       if(!rip)
  3957.         WaitForEnter();
  3958.       else
  3959.         od_get_answer("\n\r");
  3960.       chance=random(100);
  3961.       if (chance<=busted_ch_bomb) {
  3962.  
  3963.         od_printf("\n\r\n");
  3964.         ny_send_menu(BUSTED,"");
  3965.         //od_printf("\n\r\n`bright white`BUSTED!!!! .... well the police beat the hell out of you .....");
  3966.         //od_printf("\n\rWhy don't you try again tomorrow...\n\r");
  3967.         //od_printf("Ya lost 2%c of yer points!\n\r",37);
  3968.  
  3969.         cur_user->alive=UNCONCIOUS;
  3970.         points_loose(cur_user->points*.02);
  3971.         news_post("World Trade Center bombing",cur_user->name,"",2);
  3972.         if(!rip)
  3973.           WaitForEnter();
  3974.         else
  3975.           od_get_answer("\n\r");
  3976.         od_exit(10,FALSE);
  3977.       } else {
  3978.         chance=random(100);
  3979.         if (chance<=success_ch_bomb) {
  3980.  
  3981.           ny_line(258,2,1);
  3982.           if(rip) od_get_answer("\n\r");
  3983. //          od_printf("\n\r\n`bright red`W`red`ow ... it didn't fall but almost ...\n\r");
  3984.           ny_line(117,0,0);
  3985.           od_printf("%s",D_Num((long)(120*cur_user->level+100) * (long)DrgPtsCoef()));
  3986.  
  3987.           points_raise((long)120*cur_user->level+100);
  3988.           news_post("`%World Trade Center`4 was `%bombed `4today ... 10 suspects brought in","","",0);
  3989.           if(!rip) {
  3990.         od_disp_str("\n\r");
  3991.         WaitForEnter();
  3992.           } else {
  3993.         od_disp_str("::^M@OK))|#|#|#\n\r");
  3994.         od_get_answer("\n\r");
  3995.           }
  3996.         } else {
  3997.  
  3998.           ny_line(259,2,1);
  3999.           //od_printf("\n\r\n`bright red`T`red`he police found yer explosives ... Bad Luck ...\n\r");
  4000.           news_post("`@E`4xplosives found in the `%World Trade Center `4today ...","","",0);
  4001.  
  4002.           if(!rip)
  4003.         WaitForEnter();
  4004.           else
  4005.         od_get_answer("\n\r");
  4006.         }
  4007.       }
  4008.     }
  4009.       }
  4010.     }
  4011.   } while (key!='Q');
  4012. } // end of function evil ops
  4013.  
  4014.  
  4015. void
  4016. copfight_ops(user_rec *cur_user)  //This function operates the fights with monsters
  4017. {
  4018.  
  4019.     char key;  // Menu choice
  4020.  
  4021.     do {
  4022.  
  4023.         key=callmenu("LYHTQ?\n\r",C_FIG,356,TRUE);
  4024. //        key = copfight(expert);  //Getting the result of menu choice
  4025.         while (key=='?') {
  4026.           expert+=10;
  4027.           key=callmenu("LYHTQ?\n\r",C_FIG,356,TRUE);
  4028.           expert-=10;
  4029.         }
  4030.  
  4031.         if (key == 'L') {
  4032.           copattack_ops(cur_user);
  4033.         } // End of if look
  4034.         else if (key == 'T') {  // Take drugs
  4035.           take_drug();
  4036.         } // End of take drug
  4037.         else if (key == 'H') {
  4038.         ny_line(199,2,0);
  4039.         //Ya enter the hospital ...
  4040.         if(rip) od_get_answer("\n\r");
  4041.         heal_wounds();
  4042.         } // End of healing
  4043.         else if (key == 'Y') {
  4044.         DisplayStats();
  4045.         WaitForEnter();
  4046.         } // End of viewing the stats
  4047.  
  4048.     } while (key != 'Q');   // Do until quit encountered
  4049. }   // end of fight_ops function
  4050.  
  4051.  
  4052.  
  4053. void
  4054. print_cop(int num)
  4055. {
  4056.   od_set_attrib(0x0a);
  4057.   if (num==0)
  4058.     od_printf("Museum Nightguard");
  4059.   else if (num==1)
  4060.     od_printf("School Security Guy");
  4061.   else if (num==2)
  4062.     od_printf("Old Sergant");
  4063.   else if (num==3)
  4064.     od_printf("Regular Street Cop");
  4065.   else if (num==4)
  4066.     od_printf("Motocycle Cop");
  4067.   else if (num==5)
  4068.     od_printf("Detective");
  4069.   else if (num==6)
  4070.     od_printf("Gang Unit Member");
  4071.   else if (num==7)
  4072.     od_printf("Special Assigment Member");
  4073.   else if (num==8)
  4074.     od_printf("Anti Terrorist Unit Guy");
  4075.   else if (num==9)
  4076.     od_printf("SuperCop");
  4077. }
  4078.  
  4079.  
  4080.  
  4081. char
  4082. cop_list(void)
  4083. {
  4084.   char key;
  4085.  
  4086.   if(!rip){
  4087.     od_printf("\n\r\n");
  4088.  
  4089.     ny_clr_scr();
  4090.  
  4091.  
  4092.     ny_send_menu(COPS,"");
  4093.   }
  4094.  
  4095. /*  od_printf("`bright red`W`red`hich one ya wanna attack:\n\r\n");
  4096.   od_printf("`bright white`0`red`. `bright green`Museum Nightguard\n\r");
  4097.   od_printf("`bright white`1`red`. `bright green`School Security Guy\n\r");
  4098.   od_printf("`bright white`2`red`. `bright green`Old Sergant\n\r");
  4099.   od_printf("`bright white`3`red`. `bright green`Regular Street Cop\n\r");
  4100.   od_printf("`bright white`4`red`. `bright green`Motocycle Cop\n\r");
  4101.   od_printf("`bright white`5`red`. `bright green`Detective\n\r");
  4102.   od_printf("`bright white`6`red`. `bright green`Gang Unit Member\n\r");
  4103.   od_printf("`bright white`7`red`. `bright green`Special Assigment Member\n\r");
  4104.   od_printf("`bright white`8`red`. `bright green`Anti Terrorist Unit Guy\n\r");
  4105.   od_printf("`bright white`9`red`. `bright green`SuperCop\n\r\n");*/
  4106.   ny_line(260,0,0);
  4107.   //ny_disp_emu("`@S`4ooo... (`@0`4-`@9 [Q]`4=quit)");
  4108.  
  4109.   key=ny_get_answer("0123456789Q\n\r");
  4110.   if (key=='\n' || key=='\r') key='Q';
  4111.  
  4112.   if(!rip) od_putch(key);
  4113.  
  4114.   return key;
  4115. }
  4116.  
  4117. void copattack_ops(user_rec *user_on)
  4118. {
  4119.   char key;
  4120.   int num;
  4121.   long intval,hitpoints,strength,defense;
  4122.   long hit_s,en_hit_s,def_s,en_def_s;
  4123.  
  4124.   if (user_on->turns<=0) {
  4125.  
  4126.     ny_line(200,2,1);
  4127.     //od_printf("\n\r\n`bright red`You got no fights left today ...\n\r");
  4128.  
  4129.     if(!rip)
  4130.       WaitForEnter();
  4131.     else
  4132.       od_get_answer("\n\r");
  4133.     return;
  4134.   }
  4135.  
  4136.   if(expert==3) expert=1;
  4137.  
  4138.   intval=event_gen(user_on);
  4139.   if (intval==1) {
  4140.     if(rip) no_rip_m=1;
  4141.     return;
  4142.   }
  4143.   if (intval==2) {
  4144.     if(rip) no_rip_m=1;
  4145.     user_on->turns--;
  4146.     return;
  4147.   }
  4148.  
  4149.  
  4150.   key=cop_list();
  4151.  
  4152.   if (key=='Q') {
  4153.     if(rip) no_rip_m=1;
  4154.     return;
  4155.   }
  4156.  
  4157.   num= key - 48;
  4158.  
  4159.   if ( (num*2) > user_on->level) {
  4160.  
  4161.     ny_line(261,2,1);
  4162.     //od_printf("\n\r\n`bright white`You cannot attack this cop in your level...\n\r");
  4163.  
  4164.     if(!rip)
  4165.       WaitForEnter();
  4166.     else {
  4167.       od_get_answer("\n\r");
  4168.       no_rip_m=1;
  4169.     }
  4170.     return;
  4171.   }
  4172.  
  4173.   od_printf("\n\r\n");
  4174.   ny_clr_scr();
  4175.  
  4176.  
  4177.  
  4178.   ny_line(201,0,0);
  4179. //  od_printf("`bright red`Y`red`ou find ");
  4180.   print_cop(num);
  4181.   ny_line(202,0,2);
  4182.  
  4183.   ny_line(203,0,0);
  4184. //  od_printf("`bright red`H`red`e got a bad lokin' `bright green`");
  4185.   print_arm((weapon)num);
  4186.  
  4187.  
  4188.   hitpoints=random(pow(1.7,(double)num*2+1)*10 )+pow(1.7,(double)num*2+1)*10;
  4189.   strength=random(pow(1.3,(double)num*2+1)*4)+pow(1.3,(double)num*2+1)*1.8;
  4190.   defense=random(pow(1.3,(double)num*2+1)*4)+pow(1.3,(double)num*2+1)*1.8;
  4191.  
  4192.   long enhitp;
  4193.   enhitp=hitpoints;
  4194.  
  4195.   user_on->turns--;
  4196.   wrt_sts();
  4197.  
  4198.   do {
  4199.  
  4200.     bam_cf:
  4201.     ny_line(262,3,2);
  4202. //    od_printf("\n\r\n\n\r`bright red`C`red`op `bright red`F`red`ight");
  4203. //    od_printf("\n\r\n");
  4204.     print_cop(num);
  4205.     ny_line(205,0,0);
  4206.     od_printf(D_Num(hitpoints));
  4207.     ny_line(206,1,0);
  4208.     od_printf("%s\n\r\n",D_Num(user_on->hitpoints));
  4209. /*    od_printf("\n\r\n`bright red`[A] `red`- `bright red`A`red`ttack\n\r");
  4210.     od_printf("`bright red`[T] `red`- `bright red`T`red`ake `bright red`D`red`rug `bright red`A`red`nd `bright red`A`red`ttack\n\r");
  4211.     od_printf("`bright red`[G] `red`- `bright red`G`red`et `bright red`O`red`utta `bright red`H`red`ere\n\r");
  4212.     od_printf("`bright red`[Y] `red`- `bright red`Y`red`er `bright red`S`red`tats\n\r");
  4213.     od_printf("\n\r`bright red`W`red`hat ya gonna do? (`bright red`[A] G Y`red`)");*/
  4214.     ny_send_menu(ATTACK,"");
  4215.     ny_line(207,1,0);
  4216. //    ny_disp_emu("\n\r`@W`4hat ya gonna do? (`@[A] T G Y`4)");
  4217.  
  4218.  
  4219.     key=od_get_answer("ATKPRGY\n\r");
  4220.     if (key=='\n' || key=='\r') key='A';
  4221.  
  4222.     od_putch(key);
  4223.  
  4224.         if(key=='R' && user_on->rocks==0) {
  4225.           ny_line(445,2,1);
  4226.           WaitForEnter();
  4227.           goto bam_cf;
  4228.         }
  4229.  
  4230.  
  4231.         if (key == 'T') {  // Take drugs
  4232.           take_drug();
  4233.           no_rip_m=0;
  4234.           key='A';
  4235.         }
  4236.         if (key=='A' || key=='K' || key=='P' || key=='R') {
  4237.         // when atacking
  4238. //          randomize();
  4239.           if(key=='K') {
  4240.         hit_s=random(150 - user_on->kick_ability);
  4241.         if(hit_s<35) {
  4242.           hit_s = (long)user_on->strength * (pow((user_on->level/2)+2,1.2)*6.0*(user_on->kick_ability/100.0)) * (double)((random(80)+90)/100.0);
  4243.           ny_line(439,2,0);
  4244.         } else {
  4245.           hit_s=0;
  4246.           ny_line(440,2,0);
  4247.         }
  4248.           } else if(key=='P') {
  4249.         hit_s=random(140 - user_on->punch_ability);
  4250.         if(hit_s<35) {
  4251.           hit_s = (long)user_on->strength * (pow((user_on->level/2)+2,1.2)*6.0*(user_on->punch_ability/90.0)) * (double)((random(80)+90)/100.0);
  4252.           ny_line(441,2,0);
  4253.         } else {
  4254.           hit_s=0;
  4255.           ny_line(442,2,0);
  4256.         }
  4257.           } else if(key=='R') {
  4258.         hit_s=random(145 - user_on->throwing_ability);
  4259.         user_on->rocks--;
  4260.         if(hit_s<35) {
  4261.           hit_s = (long)user_on->strength * (pow((user_on->level/2)+2,1.2)*6.0*(user_on->throwing_ability/110.0)) * (double)((random(80)+90)/100.0);
  4262.           ny_line(443,2,0);
  4263.         } else {
  4264.           hit_s=0;
  4265.           ny_line(444,2,0);
  4266.         }
  4267.          }
  4268.  
  4269.  
  4270.     /*if (key == 'T') {  // Take drugs
  4271.       take_drug();
  4272.       no_rip_m=0;
  4273.       key='A';
  4274.     }
  4275.     if (key=='A') {*/
  4276.       // when atacking
  4277.  
  4278. //      randomize();
  4279.       attack_again_c:;
  4280.       if(key=='A')
  4281.     hit_s = user_on->strength * (what_arm_force(user_on->arm)) * (double)((random(80)+80)/100.0);
  4282.       // If he is on drugs
  4283.       if(user_on->drug_high > 0)
  4284.     hit_s = (hit_s * what_drug_force_a(user_on->drug,user_on->drug_high));
  4285.  
  4286. //      hit_s*=pow(1.1,user_on->level);
  4287.  
  4288.       hit_s*=(100.0-(user_on->since_got_laid*2))/100.0;
  4289.       if (user_on->drug>=COKE) hit_s-=random(user_on->drug_days_since * pow((double)user_on->drug_addiction,1.2))/60;
  4290.       if (hit_s<0) hit_s=0;
  4291.  
  4292.       en_hit_s = strength * (what_arm_force((weapon)num)) * (double)((random(75)+75)/100.0);
  4293.  
  4294.       def_s = user_on->defense * what_drug_force_d(user_on->drug,user_on->drug_high) * (double)((random(80)+140)/100.0);
  4295.       def_s*=pow(1.2,user_on->level);
  4296.       def_s*=(100.0 - (user_on->since_got_laid*2))/100.0;
  4297.       if (user_on->drug>=COKE) def_s-=random(user_on->drug_days_since * pow(user_on->drug_addiction,1.2))/60;
  4298.       if (def_s<0) def_s=0;
  4299.  
  4300.       en_def_s = defense * (double)((random(80)+50)/100.0);
  4301.  
  4302.       def_s/=2;
  4303.       en_def_s/=2;
  4304.  
  4305.       en_hit_s-=def_s;
  4306.       if (en_hit_s<0) en_hit_s=0;
  4307.  
  4308.       hit_s-=en_def_s;
  4309.       if (hit_s<0) hit_s=0;
  4310.  
  4311.       if (hit_s==0 && en_hit_s==0 && key=='A') goto attack_again_c;
  4312.  
  4313.       hitpoints-=hit_s;
  4314.  
  4315.  
  4316.       ny_line(208,2,0);
  4317. //      od_printf("\n\r\n`bright red`Y`red`a kick ");
  4318.       print_cop(num);
  4319.       ny_line(209,0,0);
  4320.       od_printf(D_Num(hit_s));
  4321.       ny_line(210,0,0);
  4322.  
  4323.  
  4324.       if (hitpoints>0) {
  4325.  
  4326.     od_printf("\n\r\n");
  4327.     print_cop(num);
  4328.     ny_line(211,0,0);
  4329.     od_printf(D_Num(en_hit_s));
  4330.     ny_line(210,0,0);
  4331.     user_on->hitpoints-=en_hit_s;
  4332.     wrt_sts();
  4333.     if (user_on->hitpoints<=0) {
  4334.       od_printf("\n\r\n");
  4335.       ny_send_menu(ASS_KICKED,"");
  4336.  
  4337. /*      od_printf("\n\r\n`bright white`You had yer ass kicked ... oh well that happens\n\r");
  4338.       od_printf("Come back tomorrow to get revenge ...\n\r");
  4339.       od_printf("You lost all the money on ya...\n\r");
  4340.       od_printf("And 2%c of yer points\n\r",37);*/
  4341.  
  4342.       news_post(user_on->say_loose,user_on->name,"A Cop",5);
  4343.       user_on->money=0;
  4344.       user_on->alive=UNCONCIOUS;
  4345.       points_loose(user_on->points*.02);
  4346.       //wrt_sts();
  4347.       WaitForEnter();
  4348.       od_exit(10,FALSE);
  4349.     }
  4350.  
  4351.       }
  4352.     } else if (key=='G') {
  4353.       intval=random(2);
  4354.       if (intval==0) {
  4355.  
  4356.     ny_line(212,2,1);
  4357.     //od_printf("\n\r\n`bright red`Y`red`a got away ...\n\r");
  4358.  
  4359.     if(!rip)
  4360.       WaitForEnter();
  4361.     else
  4362.       od_get_answer("\n\r");
  4363.     return;
  4364.       } else {
  4365.  
  4366.     ny_line(213,2,1);
  4367.     //od_printf("\n\r\n`bright red`Y`red`e couldn't find a way outta this ...\n\r");
  4368.  
  4369. //    randomize();
  4370.     en_hit_s = strength * (what_arm_force((weapon)num)) * (double)((random(75)+75)/100.0);
  4371.     def_s = user_on->defense * what_drug_force_d(user_on->drug,user_on->drug_high) * (double)((random(80)+140)/100.0);
  4372.     def_s*=pow(1.2,user_on->level);
  4373.     def_s*=(100.0-(user_on->since_got_laid*2))/100.0;
  4374.     if (user_on->drug>=COKE) def_s-=random(user_on->drug_days_since * pow(user_on->drug_addiction,1.2))/60;
  4375.     if (def_s<0) def_s=0;
  4376.     def_s/=2;
  4377.     en_hit_s-=def_s;
  4378.     if (en_hit_s<0) en_hit_s=0;
  4379.  
  4380.  
  4381.     od_printf("\n\r\n");
  4382.     print_cop(num);
  4383.     ny_line(211,0,0);
  4384.     od_printf(D_Num(en_hit_s));
  4385.     ny_line(210,0,0);
  4386.  
  4387.  
  4388.     user_on->hitpoints-=en_hit_s;
  4389.     if (user_on->hitpoints<=0) {
  4390.  
  4391.       od_printf("\n\r\n");
  4392.       ny_send_menu(ASS_KICKED,"");
  4393.  
  4394.       /*od_printf("\n\r\n`bright white`You had yer ass kicked ... oh well that happens\n\r");
  4395.       od_printf("Come back tomorrow to get revenge ...\n\r");
  4396.       od_printf("You lost all the money on ya...\n\r");
  4397.       od_printf("And 2%c of yer points\n\r",37);*/
  4398.       news_post(user_on->say_loose,user_on->name,"A Cop",5);
  4399.       user_on->alive=UNCONCIOUS;
  4400.       user_on->money=0;
  4401.       points_loose(user_on->points*.02);
  4402. //      wrt_sts();
  4403.  
  4404.       WaitForEnter();
  4405.       od_exit(10,FALSE);
  4406.     }
  4407.       }
  4408.     } else {
  4409.       DisplayStats();
  4410.       WaitForEnter();
  4411.     }
  4412.   } while (hitpoints>0);
  4413.  
  4414.   //points_raise((unsigned long)random(((num+1)*2)*12)+3);
  4415.   intval=(num+1)*(1.1)*(randomf(enhitp*.5)+enhitp*.5)+(4*(num+1));
  4416.   if (intval<enhitp) intval=enhitp;
  4417.   money_plus(intval);
  4418.  
  4419.   //od_printf("\n\r%lu",user_on->money);
  4420.   //money_plus((user_on->level+1)*random((enhitp*2))+(20*(user_on->level+1)));
  4421.   //od_printf("\n\r%lu",user_on->money);
  4422.   //user_on->money+=random((enhitp*(1.05+(.15/((user_on->level+1)/5.0)))))+(18*(user_on->level+1));
  4423.   //user_on->money+=random((enhitp*(.75+(.75/(user_on->level+1)))))+(18*(user_on->level+1));
  4424.  
  4425.   ny_line(214,2,0);
  4426.   //od_printf("\n\r\n`bright red`Y`red`ou kicked ");
  4427.   print_cop(num);
  4428. //  od_printf("'s `red`ass ...\n\r\n");
  4429.   ny_line(215,0,2);
  4430.   ny_line(216,0,0);
  4431.   od_printf(D_Num(intval));
  4432.   ny_line(217,0,0);
  4433.   intval=random(((num+1)*2)*12)+3;
  4434.   od_printf(D_Num((unsigned long)intval * (unsigned long)DrgPtsCoef()));
  4435.   ny_line(218,0,1);
  4436.   points_raise(intval);
  4437.  
  4438.   WaitForEnter();
  4439.  
  4440.  
  4441. } // End of function cop attack ops
  4442.  
  4443. double
  4444. what_drug_force_a(drug_type droga,int high) // Gives the factor for drug in use for attack
  4445. {
  4446.   if(droga == POT) return (1.0-(high/800.0));
  4447.   else if(droga == HASH) return (1.0-(high/650.0));
  4448.   else if(droga == LSD) return (1.0-(high/500.0));
  4449.   else if(droga == COKE) return ((.5*(high/100.0))+1);
  4450.   else if(droga == PCP) return ((high/100.0)+1);
  4451.   else return 1;
  4452. } // End of function what drug force a
  4453.  
  4454. double
  4455. what_drug_force_d(drug_type droga,int high) // Gives the factor for drug in use fer defense
  4456. {
  4457.   if(droga == POT) return (1.0-(high/800.0));
  4458.   else if(droga == HASH) return (1.0-(high/650.0));
  4459.   else if(droga == LSD) return (1.0-(high/500.0));
  4460.   else if(droga == COKE) return (.5*(high/100.0)+1);
  4461.   else if(droga == PCP) return 1;
  4462.   else return ((high/100.0)+1);
  4463. } // End of function what drug force d
  4464.  
  4465.  
  4466. double what_arm_force(weapon zbran) // Gives the multiplication of strengh in from weapon
  4467. {
  4468.  
  4469. if(zbran == HANDS) return 1.0;
  4470. else if(zbran == PEPPER) return 1.5;
  4471. else if(zbran == SHARP_STICK) return 1.6;
  4472. else if(zbran == SCREWDRIVER) return 1.7;
  4473. else if(zbran == KNIFE) return 2.0;
  4474. else if(zbran == HAMMER) return 3.0;
  4475. else if(zbran == CHAIN) return 4.0;
  4476. else if(zbran == LEAD_PIPE) return 5.5;
  4477. else if(zbran == GUN) return 7.0;
  4478. else if(zbran == COLT) return 8.5;
  4479. else if(zbran == RIFLE) return 11.0;
  4480. else if(zbran == ELEPHANT_GUN) return 13.3;
  4481. else if(zbran == LASER_GUN) return 16.0;
  4482. else if(zbran == NAILGUN) return 19.0;
  4483. else if(zbran == SHOTGUN) return 25.0;
  4484. else if(zbran == ASSAULT_RIFLE) return 33.3;
  4485. else if(zbran == MACHINEGUN) return 40.0;
  4486. else if(zbran == PROTON_GUN) return 54.0;
  4487. else if(zbran == GRANADE_LAUNCHER) return 70.0;
  4488. else if(zbran == NEUTRON_PHASER) return 95.0;
  4489. else if(zbran == BLASTER) return 120.0;
  4490. else if(zbran == ULTRASOUND_GUN) return 127.0;
  4491. else return 1.0;
  4492.  
  4493. } // End of function what arm force
  4494.  
  4495. int
  4496. event_gen(user_rec *user_on)
  4497. {
  4498.   int chance;
  4499.   long intval;
  4500.   char key;
  4501. //  char numstr[14];
  4502. //  ffblk ff;
  4503.  
  4504.   //randomize();
  4505.  
  4506.   ch_game_d();
  4507.   if(no_forrest_IGM==FALSE) {
  4508. //    ch_game_d();
  4509.     intval=random(9);
  4510.     if (intval>1) {
  4511.       //no event
  4512.       return 0;
  4513.     } else if (intval==0) {
  4514.       //find an igm
  4515.       forrest_IGM();
  4516.       return 1;
  4517.     }
  4518.   } else {
  4519. //    ch_game_d();
  4520.     intval=random(7);
  4521.     if (intval>0) {
  4522.       //no event
  4523.       return 0;
  4524.     }
  4525.   }
  4526.  
  4527.   intval=random(6)+1;
  4528.  
  4529.   if(intval==1) {
  4530.  
  4531.     od_printf("\n\r\n");
  4532.     if(!rip) ny_clr_scr();
  4533.     ny_line(183,0,2);
  4534.     //od_printf("`bright`Stuff happens......\n\r\n");
  4535.     if(rip) od_get_answer("\n\r");
  4536.     ny_line(186,0,1);
  4537. //    od_printf("`bright red`Y`red`a find an open car ...\n\r");
  4538.     if(rip) od_get_answer("\n\r");
  4539.     ny_line(187,0,1);
  4540. //    od_printf("`bright red`T`red`here is money inside ...\n\r");
  4541.     if(rip) od_get_answer("\n\r");
  4542.     ny_line(188,0,0);
  4543. //    od_printf("`bright red`T`red`ake the money? (`bright red`Y`red`/`bright red`N`red`)");
  4544.  
  4545.     key=ny_get_answer("YN");
  4546.  
  4547.     if(!rip)
  4548.       od_printf("%c\n\r\n",key);
  4549.     else
  4550.       od_disp_str("\n\n\r");
  4551.     if (key=='N') {
  4552.     ny_line(189,0,1);
  4553. //      od_printf("`bright red`Y`red`a consider the risks and decide it ain't a good idea\n\r");
  4554.  
  4555.       if(!rip)
  4556.     WaitForEnter();
  4557.       else
  4558.     od_get_answer("\n\r");
  4559.       return 1;
  4560.     }
  4561.  
  4562.     intval=random(3);
  4563.     if (intval==0) {
  4564.  
  4565.       ny_line(190,0,1);
  4566.       if(rip) od_get_answer("\n\r");
  4567. //      od_printf("`bright red`W`red`ow, the guy that owns the car came back and kicked yer ass!\n\r");
  4568.       ny_line(191,0,1);
  4569.       //      od_printf("`bright red`Y`red`a lost almost all yer hitpoints and 1/2 the money on ya!\n\r");
  4570.  
  4571.       money_minus(.5*user_on->money);
  4572.       user_on->hitpoints=1;
  4573.       wrt_sts();
  4574.       if(!rip)
  4575.     WaitForEnter();
  4576.       else
  4577.     od_get_answer("\n\r");
  4578.       return 1;
  4579.     }
  4580.  
  4581.     intval=randomf(40*pow(1.5,(double)user_on->level));
  4582.     ny_line(263,0,0);
  4583. //    od_printf("`bright red`W`red`ow ya got `bright red`
  4584.     od_printf(D_Num(intval));
  4585.     ny_line(264,0,1);
  4586. //    `red` from that car ...\n\r",D_Num(intval));
  4587.  
  4588.     money_plus(intval);
  4589.     points_raise((10 * user_on->level) + 10);
  4590.     if(!rip)
  4591.       WaitForEnter();
  4592.     else
  4593.       od_get_answer("\n\r");
  4594.     return 1;
  4595.   }
  4596.   if(intval==2) {
  4597.  
  4598.     od_printf("\n\r\n");
  4599.     if(!rip) ny_clr_scr();
  4600.     ny_line(183,0,2);
  4601.     if(rip) od_get_answer("\n\r");
  4602. //    od_printf("`bright`Stuff happens......\n\r\n");
  4603.     ny_line(184,0,1);
  4604.     if(rip) od_get_answer("\n\r");
  4605. //    od_printf("`bright red`Y`red`a find a rich new car ...\n\r");
  4606.     ny_line(185,0,0);
  4607. //    od_printf("`bright red`S`red`mash it? (`bright red`Y`red`/`bright red`N`red`)");
  4608.  
  4609.     key=ny_get_answer("YN");
  4610.  
  4611.     if(!rip)
  4612.       od_printf("%c\n\r\n",key);
  4613.     else
  4614.       od_disp_str("\n\r");
  4615.     if (key=='N') {
  4616.       ny_line(189,0,1);
  4617. //      od_printf("`bright red`Y`red`a consider the risks and decide it ain't a good idea\n\r");
  4618.  
  4619.       if(!rip)
  4620.     WaitForEnter();
  4621.       else
  4622.     od_get_answer("\n\r");
  4623.       return 1;
  4624.     }
  4625.  
  4626.     chance=random(100);
  4627.     if (chance<=busted_ch_car) {
  4628.  
  4629.       ny_send_menu(BUSTED,"");
  4630.       //BUSTED!!!! .... well the police beat the hell out of you .....
  4631.       //Why don't you try again tomorrow...
  4632.       //Ya lost 2% of yer points!
  4633.  
  4634.       user_on->alive=UNCONCIOUS;
  4635.       points_loose(user_on->points*.02);
  4636.       news_post("busting up a car",user_on->name,"",2);
  4637.       if(!rip)
  4638.     WaitForEnter();
  4639.       else
  4640.     od_get_answer("\n\r");
  4641.       od_exit(10,FALSE);
  4642.     } else {
  4643.       chance=random(100);
  4644.       if(chance<=success_ch_car) {
  4645.  
  4646.     ny_line(192,0,1);
  4647.     if(rip) od_get_answer("\n\r");
  4648.     //od_printf("\n\r\n`bright red`Y`red`ou totally smashed that car .... a very nice job...\n\r");
  4649.     ny_line(117,0,0);
  4650.     od_printf("%s",D_Num((long)(25*user_on->level+25) * (long)DrgPtsCoef()));
  4651.  
  4652.     points_raise((long)25 * user_on->level+25);
  4653.     if(!rip) {
  4654.       od_disp_str("\n\r");
  4655.       WaitForEnter();
  4656.     } else {
  4657.       od_disp_str("::^M@OK))|#|#|#\n\r");
  4658.       od_get_answer("\n\r");
  4659.     }
  4660.     return 1;
  4661.       } else {
  4662.  
  4663.     ny_line(406,0,1);
  4664.  
  4665.     if(!rip)
  4666.       WaitForEnter();
  4667.     else
  4668.       od_get_answer("\n\r");
  4669.     return 1;
  4670.       }
  4671.     }
  4672.   }
  4673.   if(intval==3) {
  4674.  
  4675.     od_printf("\n\r\n");
  4676.     if(!rip) ny_clr_scr();
  4677.     ny_line(183,0,2);
  4678.     if(rip) od_get_answer("\n\r");
  4679.     //od_printf("`bright`Stuff happens......\n\r\n");
  4680.     ny_line(193,0,1);
  4681.     if(rip) od_get_answer("\n\r");
  4682. //    od_printf("`bright red`Y`red`a find a bunch of hippies ...\n\r");
  4683.     ny_line(194,0,1);
  4684.     if(rip) od_get_answer("\n\r");
  4685. //    od_printf("`bright red`Y`red`a smoke some dope with them ...\n\r");
  4686.     ny_line(195,0,1);
  4687.     if(rip) od_get_answer("\n\r");
  4688. //    od_printf("`bright red`T`red`hey give ya hit of yer favorite drug ...\n\r");
  4689.     ny_line(196,0,1);
  4690.     //    od_printf("`bright red`A`red`nd yer hitpoints max out!\n\r");
  4691.  
  4692.     if (user_on->drug_hits<32767) user_on->drug_hits++;
  4693.     user_on->hitpoints=user_on->maxhitpoints;
  4694.     points_raise((10 * user_on->level) + 10);
  4695.     if(!rip)
  4696.       WaitForEnter();
  4697.     else
  4698.       od_get_answer("\n\r");
  4699.     return 1;
  4700.   }
  4701.   if(intval==4) {
  4702.  
  4703.     od_printf("\n\r\n");
  4704.     if(!rip) ny_clr_scr();
  4705.     intval=randomf(pow(1.5,(user_on->level+1))*10);
  4706.     ny_line(183,0,2);
  4707.     if(rip) od_get_answer("\n\r");
  4708.     //od_printf("`bright`Stuff happens......\n\r\n");
  4709.     ny_line(265,0,0);
  4710.     od_printf(D_Num(intval));
  4711.     ny_line(266,0,1);
  4712.  
  4713.     money_plus(intval);
  4714.     if(!rip)
  4715.       WaitForEnter();
  4716.     else
  4717.       od_get_answer("\n\r");
  4718.     return 1;
  4719.   }
  4720.   if(intval==5) {
  4721.  
  4722.     od_printf("\n\r\n");
  4723.     if(!rip) ny_clr_scr();
  4724.     intval=random(10 * (user_on->level+1))+2;
  4725.     ny_line(183,0,2);
  4726.     if(rip) od_get_answer("\n\r");
  4727.     //od_printf("`bright`Stuff happens......\n\r\n");
  4728.     ny_line(197,0,1);
  4729.     if(rip) od_get_answer("\n\r");
  4730. //    od_printf("`bright red`Y`red`a fell inside a hole ...\n\r");
  4731.     ny_line(198,0,1);
  4732.     //od_printf("`bright red`Y`red`a lost 1/3 of yer hitpoints ...\n\r");
  4733.  
  4734.     user_on->hitpoints*=2.0/3.0;
  4735.     wrt_sts();
  4736.     if(!rip)
  4737.       WaitForEnter();
  4738.     else
  4739.       od_get_answer("\n\r");
  4740.     return 1;
  4741.   }
  4742.   if(intval==6) {
  4743.     od_printf("\n\r\n");
  4744.     if(!rip) ny_clr_scr();
  4745.     intval=random(14)+2;
  4746.     if((intval + user_on->rocks) > 250) intval=250 - user_on->rocks;
  4747.     ny_line(183,0,2);
  4748.     //Stuff happens...
  4749.     if(rip)
  4750.       od_get_answer("\n\r");
  4751.     ny_line(265,0,0);
  4752.     od_printf("%d",intval);
  4753.     ny_line(438,0,1);
  4754.  
  4755.     user_on->rocks+=intval;
  4756.  
  4757.     if(!rip)
  4758.       WaitForEnter();
  4759.     else
  4760.       od_get_answer("\n\r");
  4761.  
  4762.     return 1;
  4763.   }
  4764.  
  4765.   return 0;
  4766. }
  4767.  
  4768.  
  4769. int
  4770. len_format(char str[])
  4771. {
  4772.   int len,
  4773.       cnt;
  4774.  
  4775.   len=0;
  4776.   cnt=0;
  4777.  
  4778.   while(str[cnt]!=0) {
  4779.     if(str[cnt]!='`') {
  4780.       cnt++;
  4781.       len++;
  4782.     } else {
  4783.       if(str[++cnt]!=0)
  4784.     cnt++;
  4785.     }
  4786.   }
  4787.   return len;
  4788. }
  4789.  
  4790. void
  4791. ny_send_file(char filename[])
  4792. {
  4793.   char line[124];
  4794.   FILE *phile;
  4795.   int cnt;
  4796.   int nonstop=FALSE;
  4797.   char key;
  4798.   char *keyp;
  4799.  
  4800.   phile=ShareFileOpen(filename,"r");
  4801.  
  4802.   cnt=2;
  4803.  
  4804.   while (fgets(line,120,phile)!=NULL) {
  4805.     if((keyp=strchr(line,'\n'))!=NULL) {
  4806.       *keyp='\n';
  4807.       *(keyp+1)='\r';
  4808.       *(keyp+2)='\0';
  4809.     }
  4810.     ny_disp_emu(line);
  4811.     if (nonstop==FALSE) {
  4812.       cnt++;
  4813.       if(len_format(line)>80)
  4814.     cnt++;
  4815.  
  4816.       if (cnt>od_control.user_screen_length) {
  4817.  
  4818.     ny_disp_emu("`%More (Y/n/=)");
  4819.     key=ny_get_answer("YN=\n\r");
  4820.     od_printf("\r            \r");
  4821.     if(key=='N') {
  4822.       fclose(phile);
  4823.       return;
  4824.     }
  4825.     if(key=='=')
  4826.       nonstop=TRUE;
  4827.  
  4828.     cnt=2;
  4829.     //od_printf("\n\r");
  4830.       }
  4831.     }
  4832.   }
  4833.   fclose(phile);
  4834. //  WaitForEnter();
  4835. }
  4836.  
  4837.  
  4838. void
  4839. ny_get_index(void)
  4840. {
  4841.   char line[124];
  4842.   FILE *phile;
  4843.   char numstr[26];
  4844.  
  4845.   ch_game_d();
  4846.  
  4847.   if(rip) {
  4848.    if(clean_mode==FALSE)
  4849.      phile=ShareFileOpen("MENUS.RIP","r");
  4850.    else
  4851.      phile=ShareFileOpen("MENUSC.RIP","r");
  4852.   } else {
  4853.     if(clean_mode==FALSE)
  4854.       phile=ShareFileOpen("MENUS.DAT","r");
  4855.     //  else if(clean_mode==666)
  4856.     //    phile=ShareFileOpen("MENUSXD.DAT","r");
  4857.     else
  4858.       phile=ShareFileOpen("MENUSC.DAT","r");
  4859.   }
  4860.  
  4861.   while (fgets(line,120,phile)!=NULL) {
  4862.     sscanf(line,"%s",numstr);
  4863.  
  4864.     if(strcmp(numstr,"@CENTRAL_PARK")==0)
  4865.       menu_index[(int)CENTRAL_PARK]=ftell(phile);
  4866.     else if(strcmp(numstr,"@CENTRAL_PARK_IB")==0)
  4867.       menu_index[(int)CENTRAL_PARK_IB]=ftell(phile);
  4868.     else if(strcmp(numstr,"@EVIL_STUFF")==0)
  4869.       menu_index[(int)EVIL_STUFF]=ftell(phile);
  4870.     else if(strcmp(numstr,"@BANK")==0)
  4871.       menu_index[(int)BANK]=ftell(phile);
  4872.     else if(strcmp(numstr,"@HEALING")==0)
  4873.       menu_index[(int)HEALING]=ftell(phile);
  4874.     else if(strcmp(numstr,"@FOOD")==0)
  4875.       menu_index[(int)FOOD]=ftell(phile);
  4876.     else if(strcmp(numstr,"@DRUGS")==0)
  4877.       menu_index[(int)DRUGS]=ftell(phile);
  4878.     else if(strcmp(numstr,"@ARMS")==0)
  4879.       menu_index[(int)ARMS]=ftell(phile);
  4880.     else if(strcmp(numstr,"@SEX")==0)
  4881.       menu_index[(int)SEX]=ftell(phile);
  4882.     else if(strcmp(numstr,"@MAIL")==0)
  4883.       menu_index[(int)MAIL]=ftell(phile);
  4884.     else if(strcmp(numstr,"@REST")==0)
  4885.       menu_index[(int)REST]=ftell(phile);
  4886.     else if(strcmp(numstr,"@P_FIG")==0)
  4887.       menu_index[(int)P_FIG]=ftell(phile);
  4888.     else if(strcmp(numstr,"@C_FIG")==0)
  4889.       menu_index[(int)C_FIG]=ftell(phile);
  4890.     else if(strcmp(numstr,"@S_FIG")==0)
  4891.       menu_index[(int)S_FIG]=ftell(phile);
  4892.     else if(strcmp(numstr,"@ENTRY_1")==0)
  4893.       menu_index[(int)ENTRY_1]=ftell(phile);
  4894.     else if(strcmp(numstr,"@ENTRY_2")==0)
  4895.       menu_index[(int)ENTRY_2]=ftell(phile);
  4896.     else if(strcmp(numstr,"@ONLINE")==0)
  4897.       menu_index[(int)ONLINE]=ftell(phile);
  4898.     else if(strcmp(numstr,"@NEWZ")==0)
  4899.       menu_index[(int)NEWZ]=ftell(phile);
  4900.     else if(strcmp(numstr,"@LIST")==0)
  4901.       menu_index[(int)LIST]=ftell(phile);
  4902.     else if(strcmp(numstr,"@CONSIOUS")==0)
  4903.       menu_index[(int)CONSIOUS]=ftell(phile);
  4904.     else if(strcmp(numstr,"@ATTACK")==0)
  4905.       menu_index[(int)ATTACK]=ftell(phile);
  4906.     else if(strcmp(numstr,"@WIN")==0)
  4907.       menu_index[(int)WIN]=ftell(phile);
  4908.     else if(strcmp(numstr,"@MAINT_RUN")==0)
  4909.       menu_index[(int)MAINT_RUN]=ftell(phile);
  4910.     else if(strcmp(numstr,"@WEAPONS")==0)
  4911.       menu_index[(int)WEAPONS]=ftell(phile);
  4912.     else if(strcmp(numstr,"@COPS")==0)
  4913.       menu_index[(int)COPS]=ftell(phile);
  4914.     else if(strcmp(numstr,"@NEW")==0)
  4915.       menu_index[(int)NEW]=ftell(phile);
  4916.     else if(strcmp(numstr,"@NATION")==0)
  4917.       menu_index[(int)NATION]=ftell(phile);
  4918. //    else if(strcmp(numstr,"@BLUE_LINE")==0)
  4919. //      menu_index[(int)BLUE_LINE]=ftell(phile);
  4920.     else if(strcmp(numstr,"@OTHER")==0)
  4921.       menu_index[(int)OTHER]=ftell(phile);
  4922. //    else if(strcmp(numstr,"@DEAD_OUT")==0)
  4923. //      menu_index[(int)DEAD_OUT]=ftell(phile);
  4924. //    else if(strcmp(numstr,"@BEATEN_OUT")==0)
  4925. //      menu_index[(int)BEATEN_OUT]=ftell(phile);
  4926. //    else if(strcmp(numstr,"@FOUGHT_OUT")==0)
  4927. //      menu_index[(int)FOUGHT_OUT]=ftell(phile);
  4928. //    else if(strcmp(numstr,"@WAKE_UP")==0)
  4929. //      menu_index[(int)WAKE_UP]=ftell(phile);
  4930. //    else if(strcmp(numstr,"@BEEN_ALIVE")==0)
  4931. //      menu_index[(int)BEEN_ALIVE]=ftell(phile);
  4932.     else if(strcmp(numstr,"@NEW_NAME")==0)
  4933.       menu_index[(int)NEW_NAME]=ftell(phile);
  4934.     else if(strcmp(numstr,"@NEW_WIN")==0)
  4935.       menu_index[(int)NEW_WIN]=ftell(phile);
  4936.     else if(strcmp(numstr,"@NEW_LOOSE")==0)
  4937.       menu_index[(int)NEW_LOOSE]=ftell(phile);
  4938.     else if(strcmp(numstr,"@TEN_BEST")==0)
  4939.       menu_index[(int)TEN_BEST]=ftell(phile);
  4940.     else if(strcmp(numstr,"@BUSTED")==0)
  4941.       menu_index[(int)BUSTED]=ftell(phile);
  4942.     else if(strcmp(numstr,"@ASS_KICKED")==0)
  4943.       menu_index[(int)ASS_KICKED]=ftell(phile);
  4944.     else if(strcmp(numstr,"@ASS_KICKED_P")==0)
  4945.       menu_index[(int)ASS_KICKED_P]=ftell(phile);
  4946.     else if(strcmp(numstr,"@ASS_KICKED_O")==0)
  4947.       menu_index[(int)ASS_KICKED_O]=ftell(phile);
  4948.     else if(strcmp(numstr,"@COLORS_HELP")==0)
  4949.       menu_index[(int)COLORS_HELP]=ftell(phile);
  4950.     else if(strcmp(numstr,"@CH_DRUG")==0)
  4951.       menu_index[(int)CH_DRUG]=ftell(phile);
  4952.     else if(strcmp(numstr,"@LIST_IB_SYS")==0)
  4953.       menu_index[(int)LIST_IB_SYS]=ftell(phile);
  4954.     else if(strcmp(numstr,"@IBBS_MENU")==0)
  4955.       menu_index[(int)IBBS_MENU]=ftell(phile);
  4956.     else if(strcmp(numstr,"@HITMEN")==0)
  4957.       menu_index[(int)HITMEN]=ftell(phile);
  4958.     else if(strcmp(numstr,"@TEN_BEST_IBBS")==0)
  4959.       menu_index[(int)TEN_BEST_IBBS]=ftell(phile);
  4960.   }
  4961.   fclose(phile);
  4962. }
  4963.  
  4964.  
  4965.  
  4966.  
  4967. char
  4968. ny_send_menu(menu_t menu,char allowed[],int onscreen)
  4969. {
  4970.   char line[124];
  4971.   FILE *phile;
  4972.   int cnt;
  4973.   int nonstop=FALSE;
  4974.   char key=0;
  4975.   char *keyp;
  4976.   char c_dir;
  4977.   char menu_type;
  4978.  
  4979.   menu_type=0;
  4980.  
  4981.   c_dir=c_dir_g;
  4982.  
  4983.   if(c_dir==1) ch_game_d();
  4984.  
  4985.   if(rip) {
  4986.    if(clean_mode==FALSE)
  4987.      phile=ShareFileOpen("MENUS.RIP","r");
  4988.    else
  4989.      phile=ShareFileOpen("MENUSC.RIP","r");
  4990.   } else {
  4991.     if(clean_mode==FALSE)
  4992.       phile=ShareFileOpen("MENUS.DAT","r");
  4993.     //  else if(clean_mode==666)
  4994.     //    phile=ShareFileOpen("MENUSXD.DAT","r");
  4995.     else
  4996.       phile=ShareFileOpen("MENUSC.DAT","r");
  4997.   }
  4998.  
  4999.   fseek(phile,menu_index[(int)menu],SEEK_SET);
  5000.  
  5001.   cnt=2+onscreen;
  5002.  
  5003.   while (fgets(line,120,phile)!=NULL && line[0]!='@') {
  5004.    if((cnt-onscreen)==2 && rip && line[0]=='$' && line[1]=='R' && line[2]=='I' && line[3]=='P' && line[4]=='$') {
  5005.     menu_type=1;
  5006.     od_disp_str("\n\r");
  5007.    } else {
  5008.     if(!rip) {
  5009.       key=od_get_key(FALSE);
  5010.       if (key>='a' && key<='z') key-=32;
  5011.       if (key!=0 && strchr(allowed,key)!=NULL) {
  5012.     fclose(phile);
  5013.     if(c_dir==1) ch_flag_d();
  5014.     return key;
  5015.       }
  5016.     }
  5017.  
  5018.     if((keyp=strchr(line,'\n'))!=NULL) {
  5019.       *keyp='\n';
  5020.       *(keyp+1)='\r';
  5021.       *(keyp+2)='\0';
  5022.     }
  5023.  
  5024.     if(line[0]=='\0')
  5025.       od_printf("\n\r");
  5026.     else
  5027.       if(menu_type==0)
  5028.     ny_disp_emu(line);
  5029.       else
  5030.     nyr_disp_emu(line);
  5031.  
  5032.     if (nonstop==FALSE && menu_type==0) {
  5033.       cnt++;
  5034.       if(len_format(line)>80)
  5035.     cnt++;
  5036.  
  5037.       if (cnt>od_control.user_screen_length) {
  5038.  
  5039.     ny_disp_emu("`%More (Y/n/=)");
  5040.     key=ny_get_answer("YN=\n\r");
  5041.     od_printf("\r            \r");
  5042.     if(key=='N') {
  5043.       fclose(phile);
  5044.       if(c_dir==1) ch_flag_d();
  5045.       return 0;
  5046.     }
  5047.     if(key=='=')
  5048.       nonstop=TRUE;
  5049.  
  5050.     cnt=2;
  5051.  
  5052.       }
  5053.     }
  5054.    }
  5055.   }
  5056.   fclose(phile);
  5057.   if(c_dir==1) ch_flag_d();
  5058.   return 0;
  5059. }
  5060.  
  5061. long fpoint[15];
  5062.  
  5063. void
  5064. ny_stat_line(int line,int before,int after)
  5065. {
  5066.   char c_dir;
  5067.   int cnt;
  5068.   static char *lines[44];
  5069.   FILE *phile;
  5070.   char string[302];
  5071. //  char *keyp;
  5072.   int x;
  5073.  
  5074.   if(line==-1) {
  5075.    c_dir=c_dir_g;
  5076.  
  5077.    if(c_dir==1) ch_game_d();
  5078.  
  5079.    if(rip) {
  5080.     if(clean_mode==FALSE)
  5081.       phile=ShareFileOpen("LINES.RIP","r");
  5082. //  else if(clean_mode==666)
  5083. //    phile=ShareFileOpen("LINESXD.RIP","r");
  5084.     else
  5085.       phile=ShareFileOpen("LINESC.RIP","r");
  5086.    } else {
  5087.     if(clean_mode==FALSE)
  5088.       phile=ShareFileOpen("LINES.DAT","r");
  5089. //  else if(clean_mode==666)
  5090. //    phile=ShareFileOpen("LINESXD.DAT","r");
  5091.     else
  5092.       phile=ShareFileOpen("LINESC.DAT","r");
  5093.    }
  5094.     ny_read_stat_line(38,string,phile);
  5095.     lines[0]=(char *)malloc(strlen(string)+1);
  5096.     strcpy(lines[0],string);
  5097.     ny_read_stat_line(362,string,phile);
  5098.     lines[1]=(char *)malloc(strlen(string)+1);
  5099.     strcpy(lines[1],string);
  5100.     ny_read_stat_line(363,string,phile);
  5101.     lines[2]=(char *)malloc(strlen(string)+1);
  5102.     strcpy(lines[2],string);
  5103.  
  5104.     ny_read_stat_line(364,string,phile);
  5105.     lines[3]=(char *)malloc(strlen(string)+1);
  5106.     strcpy(lines[3],string);
  5107.  
  5108.     ny_read_stat_line(365,string,phile);
  5109.     lines[4]=(char *)malloc(strlen(string)+1);
  5110.     strcpy(lines[4],string);
  5111.  
  5112.     ny_read_stat_line(366,string,phile);
  5113.     lines[5]=(char *)malloc(strlen(string)+1);
  5114.     strcpy(lines[5],string);
  5115.  
  5116.     ny_read_stat_line(399,string,phile);
  5117.     lines[6]=(char *)malloc(strlen(string)+1);
  5118.     strcpy(lines[6],string);
  5119.  
  5120.     ny_read_stat_line(39,string,phile);
  5121.     lines[7]=(char *)malloc(strlen(string)+1);
  5122.     strcpy(lines[7],string);
  5123.  
  5124.     ny_read_stat_line(367,string,phile);
  5125.     lines[8]=(char *)malloc(strlen(string)+1);
  5126.     strcpy(lines[8],string);
  5127.  
  5128.     ny_read_stat_line(368,string,phile);
  5129.     lines[9]=(char *)malloc(strlen(string)+1);
  5130.     strcpy(lines[9],string);
  5131.  
  5132.     ny_read_stat_line(270,string,phile);
  5133.     lines[10]=(char *)malloc(strlen(string)+1);
  5134.     strcpy(lines[10],string);
  5135.  
  5136.     ny_read_stat_line(369,string,phile);
  5137.     lines[11]=(char *)malloc(strlen(string)+1);
  5138.     strcpy(lines[11],string);
  5139.  
  5140.     ny_read_stat_line(370,string,phile);
  5141.     lines[12]=(char *)malloc(strlen(string)+1);
  5142.     strcpy(lines[12],string);
  5143.  
  5144.     ny_read_stat_line(371,string,phile);
  5145.     lines[13]=(char *)malloc(strlen(string)+1);
  5146.     strcpy(lines[13],string);
  5147.  
  5148.     for(x=271;x<286;x++) {
  5149.       ny_read_stat_line(x,string,phile);
  5150.       lines[x-257]=(char *)malloc(strlen(string)+1);
  5151.       strcpy(lines[x-257],string);
  5152.     }
  5153.     ny_read_stat_line(433,string,phile);
  5154.     lines[29]=(char *)malloc(strlen(string)+1);
  5155.     strcpy(lines[29],string);
  5156.  
  5157.     ny_read_stat_line(434,string,phile);
  5158.     lines[30]=(char *)malloc(strlen(string)+1);
  5159.     strcpy(lines[30],string);
  5160.  
  5161.     ny_read_stat_line(435,string,phile);
  5162.     lines[31]=(char *)malloc(strlen(string)+1);
  5163.     strcpy(lines[31],string);
  5164.  
  5165.     ny_read_stat_line(436,string,phile);
  5166.     lines[32]=(char *)malloc(strlen(string)+1);
  5167.     strcpy(lines[32],string);
  5168.  
  5169.     for(x=286;x<292;x++) {
  5170.       ny_read_stat_line(x,string,phile);
  5171.       lines[x-253]=(char *)malloc(strlen(string)+1);
  5172.       strcpy(lines[x-253],string);
  5173.     }
  5174.     ny_read_stat_line(372,string,phile);
  5175.     lines[39]=(char *)malloc(strlen(string)+1);
  5176.     strcpy(lines[39],string);
  5177.  
  5178.     ny_read_stat_line(373,string,phile);
  5179.     lines[40]=(char *)malloc(strlen(string)+1);
  5180.     strcpy(lines[40],string);
  5181.  
  5182.     ny_read_stat_line(374,string,phile);
  5183.     lines[41]=(char *)malloc(strlen(string)+1);
  5184.     strcpy(lines[41],string);
  5185.  
  5186.     ny_read_stat_line(292,string,phile);
  5187.     lines[42]=(char *)malloc(strlen(string)+1);
  5188.     strcpy(lines[42],string);
  5189.  
  5190.     ny_read_stat_line(293,string,phile);
  5191.     lines[43]=(char *)malloc(strlen(string)+1);
  5192.     strcpy(lines[43],string);
  5193.  
  5194. //    printf("\n%d\n\r",lines[42]);
  5195. //    printf("\n%s\n\r",lines[42]);
  5196.  
  5197.     fclose(phile);
  5198.     if(c_dir==1) ch_flag_d();
  5199. //    od_get_answer("K");
  5200.     return;
  5201.   }
  5202.   for(cnt=0;cnt<before;cnt++)
  5203.     od_printf("\n\r");
  5204.  
  5205.   ny_disp_emu((char *)lines[line]);
  5206. //  printf("\n%s|%d\n\r",lines[0],line);
  5207.   //od_putch('|');
  5208.  
  5209.   for(cnt=0;cnt<after;cnt++)
  5210.     od_printf("\n\r");
  5211. }
  5212.  
  5213.  
  5214. void
  5215. ny_read_stat_line(int line,char *string, FILE *phile)
  5216. {
  5217.   int cnt2,cnt;
  5218. //  FILE *phile;
  5219.   char *keyp;
  5220.  
  5221.     cnt2=line/50;
  5222.     line-=50*cnt2;
  5223.     fseek(phile,fpoint[cnt2],SEEK_SET);
  5224.     if(cnt2>0) fgets(string,300,phile);
  5225.     for(cnt=0;cnt<line;cnt++)
  5226.       fgets(string,300,phile);
  5227.  
  5228.     if((keyp=strchr(string,'\n'))!=NULL)
  5229.       *keyp='\0';
  5230.  
  5231. //    printf("\n%d\n\r",*string);
  5232. //    printf("\n%s",string);
  5233. //    scanf("%c",keyp);
  5234. }
  5235.  
  5236. void
  5237. ny_line(int line,int before,int after)
  5238. {
  5239.   char lines[302];
  5240.   FILE *phile;
  5241.   int cnt,cnt2;
  5242.   char *keyp;
  5243. //  static long fpoint[10];
  5244.   char c_dir;
  5245.  
  5246.   c_dir=c_dir_g;
  5247.  
  5248.   if(c_dir==1) ch_game_d();
  5249.  
  5250.   if(rip) {
  5251.     if(clean_mode==FALSE)
  5252.       phile=ShareFileOpen("LINES.RIP","r");
  5253. //  else if(clean_mode==666)
  5254. //    phile=ShareFileOpen("LINESXD.RIP","r");
  5255.     else
  5256.       phile=ShareFileOpen("LINESC.RIP","r");
  5257.   } else {
  5258.     if(clean_mode==FALSE)
  5259.       phile=ShareFileOpen("LINES.DAT","r");
  5260. //  else if(clean_mode==666)
  5261. //    phile=ShareFileOpen("LINESXD.DAT","r");
  5262.     else
  5263.       phile=ShareFileOpen("LINESC.DAT","r");
  5264.   }
  5265.  
  5266.  
  5267.   if(line == -1) {
  5268.     cnt2=1;
  5269.     fpoint[0]=0;
  5270.     while (fgets(lines,300,phile)!=NULL) {
  5271.       for(cnt=1;fgets(lines,300,phile)!=NULL && cnt<49;cnt++)
  5272.       fpoint[cnt2]=ftell(phile);
  5273.       cnt2++;
  5274.     }
  5275.     fclose(phile);
  5276.     if(c_dir==1) ch_flag_d();
  5277.     return;
  5278.   }
  5279.  
  5280.   cnt2=line/50;
  5281.  
  5282.   line-=50*cnt2;
  5283.  
  5284. //  line++;
  5285.  
  5286.   fseek(phile,fpoint[cnt2],SEEK_SET);
  5287.  
  5288.   if(cnt2>0) fgets(lines,300,phile);
  5289.   for(cnt=0;cnt<line;cnt++)
  5290.     fgets(lines,300,phile);
  5291.  
  5292.   fclose(phile);
  5293.  
  5294.   if((keyp=strchr(lines,'\n'))!=NULL)
  5295.     *keyp='\0';
  5296.  
  5297.   for(cnt=0;cnt<before;cnt++)
  5298.     od_printf("\n\r");
  5299.  
  5300. /*  if(before==0 && rip==TRUE && lines[0]=='!')
  5301.     od_printf("\n\r");*/
  5302.  
  5303.  
  5304.   ny_disp_emu(lines);
  5305.  
  5306.   for(cnt=0;cnt<after;cnt++)
  5307.     od_printf("\n\r");
  5308.  
  5309. /*  if(after==0 && rip==TRUE && lines[0]=='!')
  5310.     od_printf("\n\r");*/
  5311.  
  5312.   if(c_dir==1) ch_flag_d();
  5313.   return;
  5314. }
  5315.